mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[feature/new-tz-handling] Fall back to UTC, if the timezone is invalid
This should avoid problems, when the board files are updated but database isn't. PHPBB3-9558
This commit is contained in:
@@ -127,7 +127,15 @@ class phpbb_user extends phpbb_session
|
||||
*/
|
||||
}
|
||||
|
||||
$this->timezone = new DateTimeZone($user_timezone);
|
||||
try
|
||||
{
|
||||
$this->timezone = new DateTimeZone($user_timezone);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// If the timezone the user has selected is invalid, we fall back to UTC.
|
||||
$this->timezone = new DateTimeZone('UTC');
|
||||
}
|
||||
|
||||
// We include common language file here to not load it every time a custom language file is included
|
||||
$lang = &$this->lang;
|
||||
|
Reference in New Issue
Block a user