openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d33139dfdec694aba3946f445bd85af69122cb30
parent e373f3ac96dadbcb2b404b858756ca2657a3d34b
Author: dankert <openrat@jandankert.de>
Date:   Fri, 18 Mar 2022 00:30:30 +0100

Fix: Test if stored timezone value is valid in the actual server environment.

Diffstat:
Mmodules/cms/output/UIOutput.class.php | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/cms/output/UIOutput.class.php b/modules/cms/output/UIOutput.class.php @@ -81,8 +81,8 @@ class UIOutput extends BaseOutput protected static function getCustomTimezone() { $user = Session::getUser(); // the user timezone has precedence. - if ( $user && $user->timezone ) // user is set and a timezone is set - return( $user->timezone ); + if ( $user && $user->timezone && in_array( $user->timezone,timezone_identifiers_list() ) ) // user is set and a timezone is set and timezone is valid + return( $user->timezone ); // Timezone from user setting elseif ( $configuredTimezone = Configuration::subset('ui')->get('timezone') ) return $configuredTimezone; // Timezone from configuration