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/FreshRSS.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/FreshRSS.php') diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 02460af69..e374fa827 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -101,7 +101,10 @@ class FreshRSS extends Minz_FrontController { Minz_Translate::init($language); $timezone = isset(FreshRSS_Context::$user_conf) ? FreshRSS_Context::$user_conf->timezone : ''; - date_default_timezone_set($timezone != '' ? $timezone : '' . ini_get('date.timezone')); + if ($timezone == '') { + $timezone = FreshRSS_Context::defaultTimeZone(); + } + date_default_timezone_set($timezone); } private static function getThemeFileUrl($theme_id, $filename) { -- cgit v1.2.3