]> git.mxchange.org Git - friendica.git/commitdiff
Fix webmentions and microformats ("redir" only for logged in users)
authorMichael <heluecht@pirati.ca>
Sun, 21 Oct 2018 20:23:08 +0000 (20:23 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 21 Oct 2018 20:23:08 +0000 (20:23 +0000)
include/conversation.php
src/Object/Post.php

index 31920c2fcb163e4e7864cace513afa8148ce4cfe..9e813b5eb07ec6cccb14fa6831175efea87d4391 100644 (file)
@@ -353,7 +353,8 @@ function localize_item(&$item)
        $author = ['uid' => 0, 'id' => $item['author-id'],
                'network' => $item['author-network'], 'url' => $item['author-link']];
 
-       if (!empty($item['plink'])) {
+       // Only create a redirection to a magic link when logged in
+       if (!empty($item['plink']) && local_user()) {
                $item['plink'] = Contact::magicLinkbyContact($author, $item['plink']);
        }
 }
index 34a5f8138af27f1eb7deb9899652ddf9247a2f4b..15246786382ec70bbac61b928e52408a931f5178 100644 (file)
@@ -209,7 +209,13 @@ class Post extends BaseObject
 
                $author = ['uid' => 0, 'id' => $item['author-id'],
                        'network' => $item['author-network'], 'url' => $item['author-link']];
-               $profile_link = Contact::magicLinkbyContact($author);
+
+               if (local_user()) {
+                       $profile_link = Contact::magicLinkbyContact($author);
+               } else {
+                       $profile_link = $item['author-link'];
+               }
+
                if (strpos($profile_link, 'redir/') === 0) {
                        $sparkle = ' sparkle';
                }