Merge pull request #3747 from Icinga/bugfix/setuptimezone

ApplicationBootstrap#setupTimezone(): ensure a vaild default timezone to be set in any case
This commit is contained in:
Johannes Meyer 2019-04-17 14:46:22 +02:00 committed by GitHub
commit b50091fc21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -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;
}