From bc413ee8a91784368816e7f340e58a4070b52cf8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 16:06:19 +0200 Subject: [PATCH] Fix warnings --- htdocs/contact/list.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d165a0a4cc1..572bf85da3f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1222,7 +1222,7 @@ while ($i < min($num, $limit)) { if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { - print ''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''; + print ''.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d145358d62f..bb8e2e3b77b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3256,7 +3256,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli global $conf, $user, $langs, $mysoc, $hookmanager; // Clean phone parameter - $phone = preg_replace("/[\s.-]/", "", trim($phone)); + $phone = is_null($phone) ? '' : preg_replace("/[\s.-]/", "", trim($phone)); if (empty($phone)) { return ''; } diff --git a/htdocs/index.php b/htdocs/index.php index 97b82fb93ba..f9ca18f530a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -558,7 +558,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); - $textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; + $textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil(empty($board->warning_delay) ? 0 : $board->warning_delay) >= 0 ? '+' : '').ceil(empty($board->warning_delay) ? 0 : $board->warning_delay).' '.$langs->trans("days").')'; if ($board->id == 'bank_account') { $textLateTitle .= '
'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).'';