From ddb0f862578761cafc795603aff9f43d1d8b26b4 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Mon, 23 Nov 2009 13:11:18 +0000 Subject: [PATCH] check if array is present before iterating it --- calendar/inc/class.calendar_rrule.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_rrule.inc.php b/calendar/inc/class.calendar_rrule.inc.php index 8a23eb246a..c4644a00c7 100644 --- a/calendar/inc/class.calendar_rrule.inc.php +++ b/calendar/inc/class.calendar_rrule.inc.php @@ -621,9 +621,12 @@ class calendar_rrule implements Iterator { $enddate = is_a($event['recur_enddate'],'DateTime') ? $event['recur_enddate'] : new egw_time($event['recur_enddate'],$timestamp_tz); } - foreach($event['recur_exception'] as $exception) + if (is_array($event['recur_exception'])) { - $exceptions[] = is_a($exception,'DateTime') ? $exception : new egw_time($exception,$timestamp_tz); + foreach($event['recur_exception'] as $exception) + { + $exceptions[] = is_a($exception,'DateTime') ? $exception : new egw_time($exception,$timestamp_tz); + } } return new calendar_rrule($time,$event['recur_type'],$event['recur_interval'],$enddate,$event['recur_data'],$exceptions); }