From 0d0511b0992ea92b6d1505df5d52b210bb5efd24 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 3 Nov 2011 14:20:49 +0000 Subject: [PATCH] * calendar/esync: handle error regarding not getting an egw_time object but no exception is thrown; may be php 5.2.x related. occurs when a NokiaE72 tries to open Outlook invitations --- calendar/inc/class.calendar_ical.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 7eb2c694cc..53e214645b 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -2301,7 +2301,19 @@ class calendar_ical extends calendar_boupdate try { $tz = calendar_timezones::DateTimeZone($attributes['params']['TZID']); - $event['tzid'] = $tz->getName(); + // sometimes we do not get an egw_time object but no exception is thrown + // may be php 5.2.x related. occurs when a NokiaE72 tries to open Outlook invitations + if ($tz instanceof egw_time) + { + $event['tzid'] = $tz->getName(); + } + else + { + error_log(__METHOD__ . '() unknown TZID=' + . $attributes['params']['TZID'] . ', defaulting to timezone "' + . date_default_timezone_get() . '".'); + $event['tzid'] = date_default_timezone_get(); // default to current timezone + } } catch(Exception $e) {