TimezoneDetect: support comma-separated icingaweb2-tzo cookies

This commit is contained in:
Alexander A. Klimov 2016-02-25 14:41:42 +01:00
parent af18334e3e
commit 45168caa37
1 changed files with 5 additions and 1 deletions

View File

@ -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;