From dbdb7869c47ab8c9e3a42384401a7e29599e192f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 19 Jan 2023 18:26:04 +0100 Subject: Safer timezone set (#5021) * Safer timezone set Add missing tzdata in Docker :newest Fallback to UTC if no timezone is defined at all #fix https://github.com/FreshRSS/FreshRSS/pull/4906#issuecomment-1386747169 * Better refactoring Show fallback timezone everywhere --- app/Models/Context.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index 0176e77fa..734458d7f 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -500,4 +500,8 @@ class FreshRSS_Context { return false; } + public static function defaultTimeZone(): string { + $timezone = ini_get('date.timezone'); + return $timezone != '' ? $timezone : 'UTC'; + } } -- cgit v1.2.3