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
This commit is contained in:
Ralf Becker 2021-10-12 11:44:24 +02:00
parent c844a47889
commit 0f4abf8606
2 changed files with 2 additions and 2 deletions

View File

@ -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']]))
{

View File

@ -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');