]> git.mxchange.org Git - friendica.git/commitdiff
The value is used twice, so use a variable
authorMichael <heluecht@pirati.ca>
Tue, 10 Sep 2019 04:04:07 +0000 (04:04 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 10 Sep 2019 04:04:07 +0000 (04:04 +0000)
src/Model/Contact.php

index ffdee6aa0ecd1cbf77b35870fa04ea7ee7c1d3fe..cb79e0329248d82318dc7855df0ba05be9daf125 100644 (file)
@@ -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'];