ApplicationBootstrap#setupTimezone(): ensure a vaild default timezone to be set in any case

This commit is contained in:
Alexander A. Klimov 2019-04-16 10:35:36 +02:00
parent 6a23a641ac
commit 5d4cdfe13f

@ -618,11 +618,7 @@ abstract class ApplicationBootstrap
{
$timezone = $this->detectTimeZone();
if ($timezone === null || @date_default_timezone_set($timezone) === false) {
$timezone = @date_default_timezone_get();
if ($timezone === false) {
$timezone = 'UTC';
date_default_timezone_set($timezone);
}
date_default_timezone_set(@date_default_timezone_get());
}
return $this;
}