X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=src%2FModel%2FProfile.php;h=0c1ae01e413d71908c92211f07fa6ce5ff876993;hb=146646c4d43f49e723b830b9ffb0208bad3431a3;hp=67c6a0eb68cd3ccdfe3f525248df802c4a55d58a;hpb=c0b78a9720707c13882b8d606b91565234c7b447;p=friendica.git diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 67c6a0eb68..0c1ae01e41 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -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, [