From 20aab1b6f22f5c0563b62b8cef0954017c5edcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Mon, 8 Mar 2010 06:54:02 +0000 Subject: [PATCH] Handle failures in event2rrule gracefully --- calendar/inc/class.calendar_rrule.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_rrule.inc.php b/calendar/inc/class.calendar_rrule.inc.php index 4efab3cced..8a6dca8629 100644 --- a/calendar/inc/class.calendar_rrule.inc.php +++ b/calendar/inc/class.calendar_rrule.inc.php @@ -627,10 +627,11 @@ class calendar_rrule implements Iterator * @param boolean $usertime=true true: event timestamps are usertime (default for calendar_bo::(read|search), false: servertime * @param string $to_tz timezone for exports (null for event's timezone) * - * @return calendar_rrule + * @return calendar_rrule false on error */ public static function event2rrule(array $event,$usertime=true,$to_tz=null) { + if (!is_array($event) || !isset($event['tzid'])) return false; if (!$to_tz) $to_tz = $event['tzid']; $timestamp_tz = $usertime ? egw_time::$user_timezone : egw_time::$server_timezone; $time = is_a($event['start'],'DateTime') ? $event['start'] : new egw_time($event['start'],$timestamp_tz);