fix PHP TypeError count() Argument #1 ($value) must be of type Countable|array, string given

This commit is contained in:
ralf 2023-12-13 09:59:41 +02:00
parent 35a9a9bda5
commit 0da5d651f8

View File

@ -688,8 +688,11 @@ class infolog_so
// update attendees/delegates // update attendees/delegates
if (array_key_exists('info_responsible', $values) || array_key_exists('info_cc', $values)) if (array_key_exists('info_responsible', $values) || array_key_exists('info_cc', $values))
{ {
$users = empty($values['info_responsible']) ? array() : if (!is_array($values['info_responsible']))
array_combine($values['info_responsible'], array_fill(0, count($values['info_responsible']), null)); {
$values['info_responsible'] = empty($values['info_responsible']) ? [] : explode(',', $values['info_responsible']);
}
$users = array_combine($values['info_responsible'], array_fill(0, count($values['info_responsible']), null));
foreach(!empty($values['info_cc']) ? explode(',', $values['info_cc']) : array() as $email) foreach(!empty($values['info_cc']) ? explode(',', $values['info_cc']) : array() as $email)
{ {