mirror of
https://github.com/friendica/friendica
synced 2024-11-09 17:02:54 +00:00
Fix null value passed to string functions deprecation notices
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513
This commit is contained in:
parent
6b555f64da
commit
0ec7238da4
6 changed files with 7 additions and 7 deletions
|
@ -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 [];
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
Loading…
Reference in a new issue