Silence "PHP Warning: count(): Parameter must be an array or an object that implements Countable"

This commit is contained in:
nathangray 2021-05-31 14:35:12 -06:00
parent 8bb4f56149
commit 320a96037f

View File

@ -578,7 +578,7 @@ class calendar_ical extends calendar_boupdate
$organizerUID = $event['owner']; $organizerUID = $event['owner'];
} }
// do NOT use ORGANIZER for events without further participants or a different organizer // do NOT use ORGANIZER for events without further participants or a different organizer
if (count($event['participants']) > 1 || !isset($event['participants'][$event['owner']]) || $event['owner'] != $this->user) if (is_array($event['participants']) && (count($event['participants']) > 1 || !isset($event['participants'][$event['owner']])) || $event['owner'] != $this->user)
{ {
$attributes['ORGANIZER'] = $organizerURL; $attributes['ORGANIZER'] = $organizerURL;
$parameters['ORGANIZER']['CN'] = $organizerCN; $parameters['ORGANIZER']['CN'] = $organizerCN;