diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index be7448a336..6d19eb1635 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -794,7 +794,7 @@ class Conversation return []; } - $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked')); + $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked') ?? ''); if (empty($str_blocked)) { return []; } diff --git a/src/Database/Database.php b/src/Database/Database.php index a34b17adbe..036e6ec2cb 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -110,7 +110,7 @@ class Database $this->connected = false; $port = 0; - $serveraddr = trim($this->configCache->get('database', 'hostname')); + $serveraddr = trim($this->configCache->get('database', 'hostname') ?? ''); $serverdata = explode(':', $serveraddr); $host = trim($serverdata[0]); if (count($serverdata) > 1) { diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 04c0db0f80..854e5d8f91 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -687,7 +687,7 @@ class Media $previews[] = $medium['preview']; } - $type = explode('/', explode(';', $medium['mimetype'])[0]); + $type = explode('/', explode(';', $medium['mimetype'] ?? '')[0]); if (count($type) < 2) { Logger::info('Unknown MimeType', ['type' => $type, 'media' => $medium]); $filetype = 'unkn'; diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index f7fc9d7934..ab6624f776 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -324,8 +324,8 @@ class Site extends BaseAdmin /* Installed langs */ $lang_choices = DI::l10n()->getAvailableLanguages(); - if (strlen(DI::config()->get('system', 'directory_submit_url')) && - !strlen(DI::config()->get('system', 'directory'))) { + if (DI::config()->get('system', 'directory_submit_url') && + !DI::config()->get('system', 'directory')) { DI::config()->set('system', 'directory', dirname(DI::config()->get('system', 'directory_submit_url'))); DI::config()->delete('system', 'directory_submit_url'); } diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index b3d0c03733..eadc67818d 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -327,7 +327,7 @@ class Profile extends BaseModule '$submit' => $this->t('Submit'), '$lbl_info1' => $lbl_info1, '$lbl_info2' => $this->t('Their personal note'), - '$reason' => trim($contact['reason']), + '$reason' => trim($contact['reason'] ?? ''), '$infedit' => $this->t('Edit contact notes'), '$common_link' => 'contact/' . $contact['id'] . '/contacts/common', '$relation_text' => $relation_text, diff --git a/src/Module/User/PortableContacts.php b/src/Module/User/PortableContacts.php index 6629994810..6a3c1201d9 100644 --- a/src/Module/User/PortableContacts.php +++ b/src/Module/User/PortableContacts.php @@ -233,7 +233,7 @@ class PortableContacts extends BaseModule } if ($selectedFields['tags']) { - $tags = str_replace(',', ' ', $contact['keywords']); + $tags = str_replace(',', ' ', $contact['keywords'] ?? ''); $tags = explode(' ', $tags); $cleaned = [];