From 4f6b5123a2e24fd60cf20298153ef6d90b5e58fe Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 8 Sep 2026 09:59:35 +0200 Subject: [PATCH] fix: Use compatibility list when checking for timezone Intl.DateTimeFormat().resolvedOptions().timeZone might return some legacy timezone like Europe/Kiev instead of Europe/Kyiv Signed-off-by: Carl Schwan --- lib/Controller/TimezoneController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/TimezoneController.php b/lib/Controller/TimezoneController.php index 849e3b6ea..88adb20a8 100644 --- a/lib/Controller/TimezoneController.php +++ b/lib/Controller/TimezoneController.php @@ -36,7 +36,7 @@ public function __construct( #[NoAdminRequired] #[UseSession] public function setTimezone(string $timezone, int $timezoneOffset): JSONResponse { - if (!in_array($timezone, \DateTimeZone::listIdentifiers())) { + if (!in_array($timezone, \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC))) { throw new \InvalidArgumentException('Invalid timezone'); } if ($this->userId === null) {