The value is used twice, so use a variable
This commit is contained in:
parent
8fc8e26e23
commit
0a0a961c52
|
@ -2700,8 +2700,10 @@ class Contact extends BaseObject
|
||||||
*/
|
*/
|
||||||
public static function magicLinkByContact($contact, $url = '')
|
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)) {
|
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
|
// Only redirections to the same host do make sense
|
||||||
|
@ -2714,7 +2716,7 @@ class Contact extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($contact['id'])) {
|
if (empty($contact['id'])) {
|
||||||
return $url ?: $contact['url'];
|
return $destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect = 'redir/' . $contact['id'];
|
$redirect = 'redir/' . $contact['id'];
|
||||||
|
|
Loading…
Reference in a new issue