From 5e24cc0c9b4161390c87437e8ef40443fb72ee15 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 10 Nov 2009 20:38:00 +0000 Subject: [PATCH] "UTC is treated specially: it's implicitly mapped to tz_id=-1 (to be able to store it for events), but calendar_ical creates NO VTIMEZONE component for it." --- calendar/inc/class.calendar_timezones.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/calendar/inc/class.calendar_timezones.inc.php b/calendar/inc/class.calendar_timezones.inc.php index 71edefac5d..75ef98c955 100644 --- a/calendar/inc/class.calendar_timezones.inc.php +++ b/calendar/inc/class.calendar_timezones.inc.php @@ -24,6 +24,9 @@ * * Mapping Windows timezone to standard TZID's: * @link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/windows_tzid.html + * + * UTC is treated specially: it's implicitly mapped to tz_id=-1 (to be able to store it for events), + * but calendar_ical creates NO VTIMEZONE component for it. */ class calendar_timezones { @@ -149,6 +152,16 @@ class calendar_timezones { self::$tz_cache =& egw_cache::getSession(__CLASS__,'tz_cache'); self::$tz2id =& egw_cache::getSession(__CLASS__,'tz2id'); + + // init cache with mapping UTC <--> -1, as UTC is no real timezone, but we need to be able to use it in calendar + if (!is_array(self::$tz2id)) + { + self::$tz_cache = array('-1' => array( + 'tzid' => 'UTC', + 'id' => -1, + )); + self::$tz2id = array('UTC' => -1); + } } /**