mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
TimezoneDetect: Verify the timezone name cookie
This commit is contained in:
parent
ef4b59123e
commit
380b3688bd
@ -3,6 +3,8 @@
|
||||
|
||||
namespace Icinga\Util;
|
||||
|
||||
use DateTimeZone;
|
||||
|
||||
/**
|
||||
* Retrieve timezone information from cookie
|
||||
*/
|
||||
@ -36,9 +38,11 @@ class TimezoneDetect
|
||||
return;
|
||||
}
|
||||
|
||||
if (array_key_exists(self::$cookieName, $_COOKIE)) {
|
||||
if (in_array($_COOKIE[self::$cookieName] ?? null, DateTimeZone::listIdentifiers(), true)) {
|
||||
self::$timezoneName = $_COOKIE[self::$cookieName];
|
||||
self::$success = true;
|
||||
} else {
|
||||
self::$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user