From 0f4abf860684c0f4dc58b2786e3e1dcd831ba961 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 12 Oct 2021 11:44:24 +0200 Subject: [PATCH] fix PHP 8.0 TypeError: - array_combine(): Argument #1 ($keys) must be of type array, null given - count(): Argument #1 ($value) must be of type Countable|array, null given --- admin/inc/class.admin_mail.inc.php | 2 +- calendar/inc/class.calendar_uiforms.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php index 338d659cf1..db74bc11db 100644 --- a/admin/inc/class.admin_mail.inc.php +++ b/admin/inc/class.admin_mail.inc.php @@ -1285,7 +1285,7 @@ class admin_mail { $sel_options['ident_email_alias'] = array_merge( array('' => $content['mailLocalAddress'].' ('.lang('Default').')'), - array_combine($content['mailAlternateAddress'], $content['mailAlternateAddress'])); + array_combine($content['mailAlternateAddress'] ?? [], $content['mailAlternateAddress'] ?? [])); // if admin explicitly set a non-alias, we need to add it to aliases to keep it after storing signature by user if ($content['ident_email'] !== $content['mailLocalAddress'] && !isset($sel_options['ident_email_alias'][$content['ident_email']])) { diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 3b95d480f0..a71a56af23 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1924,7 +1924,7 @@ class calendar_uiforms extends calendar_ui $sel_options['owner'][$uid] = $this->bo->participant_name($uid); } } - $content['no_add_alarm'] = !count($sel_options['owner']); // no rights to set any alarm + $content['no_add_alarm'] = empty($sel_options['owner']) || !count((array)$sel_options['owner']); // no rights to set any alarm if (!$event['id']) { $etpl->set_cell_attribute('button[new_alarm]','type','checkbox');