Fix magic links in contact photo menu

- They were using a URL format obsolete for years
This commit is contained in:
Hypolite Petovan 2023-05-17 19:53:22 -04:00
parent 878f144bc1
commit ff80e46eb0
2 changed files with 9 additions and 16 deletions

View file

@ -378,7 +378,11 @@ class Item
'url' => $item['author-link'],
];
$profile_link = Contact::magicLinkByContact($author, $item['author-link']);
$sparkle = (strpos($profile_link, 'contact/redir/') === 0);
if (strpos($profile_link, 'contact/redir/') === 0) {
$status_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/status']);
$photos_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/photos']);
$profile_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/profile']);
}
$cid = 0;
$pcid = $item['author-id'];
@ -392,12 +396,6 @@ class Item
$rel = $contact['rel'];
}
if ($sparkle) {
$status_link = $profile_link . '/status';
$photos_link = $profile_link . '/photos';
$profile_link = $profile_link . '/profile';
}
if (!empty($pcid)) {
$contact_url = 'contact/' . $pcid;
$posts_link = $contact_url . '/posts';