mirror of
https://github.com/friendica/friendica
synced 2025-04-27 09:10:12 +00:00
Address some PHP 8.1 deprecation notices
- Replace a strstr call by strpos in Model\APContact - Simplify conditions in Protocol\DFRN - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1331012289
This commit is contained in:
parent
6c2f42ed03
commit
150c0e0750
3 changed files with 7 additions and 6 deletions
|
@ -538,7 +538,7 @@ class DFRN
|
|||
|
||||
XML::addElement($doc, $author, 'poco:utcOffset', DateTimeFormat::timezoneNow($profile['timezone'], 'P'));
|
||||
|
||||
if (trim($profile['homepage']) != '') {
|
||||
if (trim($profile['homepage'])) {
|
||||
$urls = $doc->createElement('poco:urls');
|
||||
XML::addElement($doc, $urls, 'poco:type', 'homepage');
|
||||
XML::addElement($doc, $urls, 'poco:value', $profile['homepage']);
|
||||
|
@ -546,7 +546,7 @@ class DFRN
|
|||
$author->appendChild($urls);
|
||||
}
|
||||
|
||||
if (trim($profile['pub_keywords']) != '') {
|
||||
if (trim($profile['pub_keywords'] ?? '')) {
|
||||
$keywords = explode(',', $profile['pub_keywords']);
|
||||
|
||||
foreach ($keywords as $keyword) {
|
||||
|
@ -554,7 +554,7 @@ class DFRN
|
|||
}
|
||||
}
|
||||
|
||||
if (trim($profile['xmpp']) != '') {
|
||||
if (trim($profile['xmpp'])) {
|
||||
$ims = $doc->createElement('poco:ims');
|
||||
XML::addElement($doc, $ims, 'poco:type', 'xmpp');
|
||||
XML::addElement($doc, $ims, 'poco:value', $profile['xmpp']);
|
||||
|
@ -562,7 +562,7 @@ class DFRN
|
|||
$author->appendChild($ims);
|
||||
}
|
||||
|
||||
if (trim($profile['locality'] . $profile['region'] . $profile['country-name']) != '') {
|
||||
if (trim($profile['locality'] . $profile['region'] . $profile['country-name'])) {
|
||||
$element = $doc->createElement('poco:address');
|
||||
|
||||
XML::addElement($doc, $element, 'poco:formatted', Profile::formatLocation($profile));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue