]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Replace deprecated calls to defaults() by ?? and ?: in src/
[friendica.git] / src / Model / Profile.php
index 67c6a0eb68cd3ccdfe3f525248df802c4a55d58a..0c1ae01e413d71908c92211f07fa6ce5ff876993 100644 (file)
@@ -90,7 +90,7 @@ class Profile
                        $location .= $profile['locality'];
                }
 
-               if (!empty($profile['region']) && (defaults($profile, 'locality', '') != $profile['region'])) {
+               if (!empty($profile['region']) && (($profile['locality'] ?? '') != $profile['region'])) {
                        if ($location) {
                                $location .= ', ';
                        }
@@ -322,7 +322,7 @@ class Profile
                        return $o;
                }
 
-               $profile['picdate'] = urlencode(defaults($profile, 'picdate', ''));
+               $profile['picdate'] = urlencode($profile['picdate'] ?? '');
 
                if (($profile['network'] != '') && ($profile['network'] != Protocol::DFRN)) {
                        $profile['network_link'] = Strings::formatNetworkName($profile['network'], $profile['url']);
@@ -384,7 +384,7 @@ class Profile
 
                        if (Contact::canReceivePrivateMessages($profile)) {
                                if ($visitor_is_followed || $visitor_is_following) {
-                                       $wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode(defaults($profile, 'addr', ''));
+                                       $wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode($profile['addr'] ?? '');
                                } elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
                                        $wallmessage_link = 'wallmessage/' . $profile['nickname'];
                                }
@@ -465,9 +465,9 @@ class Profile
                                'fullname' => $profile['name'],
                                'firstname' => $firstname,
                                'lastname' => $lastname,
-                               'photo300' => defaults($profile, 'contact_photo', ''),
-                               'photo100' => defaults($profile, 'contact_thumb', ''),
-                               'photo50' => defaults($profile, 'contact_micro', ''),
+                               'photo300' => $profile['contact_photo'] ?? '',
+                               'photo100' => $profile['contact_thumb'] ?? '',
+                               'photo50' => $profile['contact_micro'] ?? '',
                        ];
                } else {
                        $diaspora = false;
@@ -530,7 +530,7 @@ class Profile
                        $p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL);
                }
 
-               $p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));
+               $p['url'] = Contact::magicLink(($p['url'] ?? '') ?: $profile_url);
 
                $tpl = Renderer::getMarkupTemplate('profile_vcard.tpl');
                $o .= Renderer::replaceMacros($tpl, [