Merge pull request #5984 from annando/microformats
Fix webmentions and microformats ("redir" only for logged in users)
This commit is contained in:
commit
6324d4595f
2 changed files with 9 additions and 2 deletions
|
@ -353,7 +353,8 @@ function localize_item(&$item)
|
||||||
$author = ['uid' => 0, 'id' => $item['author-id'],
|
$author = ['uid' => 0, 'id' => $item['author-id'],
|
||||||
'network' => $item['author-network'], 'url' => $item['author-link']];
|
'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']);
|
$item['plink'] = Contact::magicLinkbyContact($author, $item['plink']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,13 @@ class Post extends BaseObject
|
||||||
|
|
||||||
$author = ['uid' => 0, 'id' => $item['author-id'],
|
$author = ['uid' => 0, 'id' => $item['author-id'],
|
||||||
'network' => $item['author-network'], 'url' => $item['author-link']];
|
'network' => $item['author-network'], 'url' => $item['author-link']];
|
||||||
|
|
||||||
|
if (local_user()) {
|
||||||
$profile_link = Contact::magicLinkbyContact($author);
|
$profile_link = Contact::magicLinkbyContact($author);
|
||||||
|
} else {
|
||||||
|
$profile_link = $item['author-link'];
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($profile_link, 'redir/') === 0) {
|
if (strpos($profile_link, 'redir/') === 0) {
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue