MantisBT: master de1679d5

Author Committer Branch Timestamp Parent
dregad dregad master 2020-12-23 07:57 master 2db996b5
Affected Issues  0027796: Using an empty timezone causes PHP notice on PHP 8
Changeset

Improve timezone setting logic

Previously, core.php tried to set the default timezone to the value
stored in global configuration, with error suppression. Due to [1],
this does not actually prevent the notice from appearing with PHP 8.

Refactored the code to get the system's default time zone if it is not
defined in configuration. A PHP notice is still thrown if the specified
timezone is not valid, as documented in the code.

Also, since PHP 5.4, date_default_timezone_get() no longer throws a
warning so the '@' operator is not needed anymore.

Fixes 0027796

mod - core.php Diff File