Merge pull request #7606 from annando/fix-invalid-url

Replace not working "redir" link with a working one
This commit is contained in:
Tobias Diekershoff 2019-09-10 06:29:55 +02:00 committed by GitHub
commit 3d5d50a25b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -2707,8 +2707,10 @@ class Contact extends BaseObject
*/
public static function magicLinkByContact($contact, $url = '')
{
$destination = $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
if ((!local_user() && !remote_user()) || ($contact['network'] != Protocol::DFRN)) {
return $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
return $destination;
}
// Only redirections to the same host do make sense
@ -2721,7 +2723,7 @@ class Contact extends BaseObject
}
if (empty($contact['id'])) {
return $url ?: $contact['url'];
return $destination;
}
$redirect = 'redir/' . $contact['id'];