mirror of
https://github.com/friendica/friendica
synced 2025-04-27 23:10:12 +00:00
Replace deprecated calls to defaults() by ?? and ?: in src/
This commit is contained in:
parent
c0b78a9720
commit
146646c4d4
41 changed files with 239 additions and 233 deletions
|
@ -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, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue