]> git.mxchange.org Git - friendica.git/commitdiff
fix magic links for item mentions
authorrabuzarus <rabuzarus@t-online.de>
Sun, 17 Feb 2019 16:19:57 +0000 (17:19 +0100)
committerrabuzarus <rabuzarus@t-online.de>
Sun, 17 Feb 2019 16:19:57 +0000 (17:19 +0100)
src/Model/Term.php

index 6a213d445b2df4c7b036c7c0728b8cd86a8d13a4..6e3425524a1dcff0dd6e5b2f10effd6babcd5385 100644 (file)
@@ -272,10 +272,10 @@ class Term
 
                        $author = ['uid' => 0, 'id' => $item['author-id'],
                                'network' => $item['author-network'], 'url' => $item['author-link']];
-                       $tag['url'] = Contact::magicLinkByContact($author, $tag['url']);
 
                        $prefix = '';
                        if ($tag['type'] == TERM_HASHTAG) {
+                               $tag['url'] = Contact::magicLinkByContact($author, $tag['url']);
                                if ($orig_tag != $tag['url']) {
                                        $item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
                                }
@@ -283,6 +283,7 @@ class Term
                                $return['hashtags'][] = '#<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
                                $prefix = '#';
                        } elseif ($tag['type'] == TERM_MENTION) {
+                               $tag['url'] = Contact::magicLink($tag['url']);
                                $return['mentions'][] = '@<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
                                $prefix = '@';
                        }