From 0a0a961c52287c5a4f5d04d760eef1aab9c77774 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 10 Sep 2019 04:04:07 +0000 Subject: [PATCH] The value is used twice, so use a variable --- src/Model/Contact.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index ffdee6aa0e..cb79e03292 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2700,8 +2700,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 @@ -2714,7 +2716,7 @@ class Contact extends BaseObject } if (empty($contact['id'])) { - return $url ?: $contact['url']; + return $destination; } $redirect = 'redir/' . $contact['id']; -- 2.39.5