parent
80d3abed9d
commit
e5f462c2fa
|
@ -53,21 +53,19 @@ class TimezoneDetect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Platform::isCli() === false && array_key_exists(self::$cookieName, $_COOKIE)) {
|
if (Platform::isCli() === false && array_key_exists(self::$cookieName, $_COOKIE)) {
|
||||||
$cookieValue = $_COOKIE[self::$cookieName];
|
$matches = array();
|
||||||
list($offset, $dst) = explode(
|
if (preg_match('/\A(-?\d+)[\-,](\d+)\z/', $_COOKIE[self::$cookieName], $matches)) {
|
||||||
strpos($cookieValue, ',') === false ? '-' : ',',
|
$offset = $matches[1];
|
||||||
$cookieValue
|
$timezoneName = timezone_name_from_abbr('', (int) $offset, (int) $matches[2]);
|
||||||
);
|
|
||||||
$timezoneName = timezone_name_from_abbr('', (int)$offset, (int)$dst);
|
|
||||||
|
|
||||||
self::$success = (bool)$timezoneName;
|
self::$success = (bool) $timezoneName;
|
||||||
|
if (self::$success) {
|
||||||
if (self::$success === true) {
|
|
||||||
self::$offset = $offset;
|
self::$offset = $offset;
|
||||||
self::$timezoneName = $timezoneName;
|
self::$timezoneName = $timezoneName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get offset
|
* Get offset
|
||||||
|
|
Loading…
Reference in New Issue