From 45168caa375feafdc01665627972339c49773cf9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 25 Feb 2016 14:41:42 +0100 Subject: [PATCH] TimezoneDetect: support comma-separated icingaweb2-tzo cookies --- library/Icinga/Util/TimezoneDetect.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Util/TimezoneDetect.php b/library/Icinga/Util/TimezoneDetect.php index f5e033ae0..9b6bbc8dc 100644 --- a/library/Icinga/Util/TimezoneDetect.php +++ b/library/Icinga/Util/TimezoneDetect.php @@ -53,7 +53,11 @@ class TimezoneDetect } if (Platform::isCli() === false && array_key_exists(self::$cookieName, $_COOKIE)) { - list($offset, $dst) = explode('-', $_COOKIE[self::$cookieName]); + $cookieValue = $_COOKIE[self::$cookieName]; + list($offset, $dst) = explode( + strpos($cookieValue, ',') === false ? '-' : ',', + $cookieValue + ); $timezoneName = timezone_name_from_abbr('', (int)$offset, (int)$dst); self::$success = (bool)$timezoneName;