aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/user.php')
-rw-r--r--phpBB/includes/user.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php
index 48c328214d..fcbfaaddfa 100644
--- a/phpBB/includes/user.php
+++ b/phpBB/includes/user.php
@@ -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;