From 26c67aa33d600f96ff2101bad9d9d04995c35231 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 18 Dec 2017 19:47:27 +0700 Subject: [PATCH] default to user timezone on export, if event has no or invalid timezone --- calendar/inc/class.calendar_ical.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 4c7d30f61f..624f340486 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -309,7 +309,15 @@ class calendar_ical extends calendar_boupdate if (!isset(self::$tz_cache[$event['tzid']])) { - self::$tz_cache[$event['tzid']] = calendar_timezones::DateTimeZone($event['tzid']); + try { + self::$tz_cache[$event['tzid']] = calendar_timezones::DateTimeZone($event['tzid']); + } + catch (Exception $e) { + // log unknown timezones + if (!empty($event['tzid'])) __egw_log_exception($e); + // default for no timezone and unkown to user timezone + self::$tz_cache[$event['tzid']] = Api\DateTime::$user_timezone; + } } if ($this->so->isWholeDay($event)) $event['whole_day'] = true; @@ -2488,7 +2496,7 @@ class calendar_ical extends calendar_boupdate $component->getAllAttributes('DTEND'), $component->getAllAttributes('DURATION')) as $attributes) { -error_log(__METHOD__."() attribute=".array2string($attributes)); + //error_log(__METHOD__."() attribute=".array2string($attributes)); switch ($attributes['name']) { case 'DTSTART':