Merge pull request #10763 from MrPetovan/task/10745-redir-private-posts

Limit /redir links to private posts
This commit is contained in:
Michael Vogel 2021-09-26 07:03:08 +02:00 committed by GitHub
commit 1cf759d414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,7 +177,7 @@ function localize_item(&$item)
// add sparkle links to appropriate permalinks // add sparkle links to appropriate permalinks
// Only create a redirection to a magic link when logged in // Only create a redirection to a magic link when logged in
if (!empty($item['plink']) && Session::isAuthenticated()) { if (!empty($item['plink']) && Session::isAuthenticated() && $item['private'] == Item::PRIVATE) {
$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']];
$item['plink'] = Contact::magicLinkByContact($author, $item['plink']); $item['plink'] = Contact::magicLinkByContact($author, $item['plink']);