[icinga-checkins] icinga.org: icingaweb2/master: TimezoneDetect: support comma-separated icingaweb2-tzo cookies

git at icinga.org git at icinga.org
Thu Feb 25 14:45:53 CET 2016


Module: icingaweb2
Branch: master
Commit: 45168caa375feafdc01665627972339c49773cf9
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=45168caa375feafdc01665627972339c49773cf9

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Thu Feb 25 14:41:42 2016 +0100

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 f5e033a..9b6bbc8 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;



More information about the icinga-checkins mailing list