diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-05-26 10:30:24 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-05-26 10:34:54 +0200 |
commit | 9a8a86efcae2c3c5ff36f71cbba7acd5ce3d4c6f (patch) | |
tree | 4425872aa8db1c5686d497b58b7ec7a3e95b5bd9 /program | |
parent | 2eeab1f57facc8a39aa6ff8b3baccd9d0cb96bbc (diff) |
Catch DateTime* exceptions (#1488497) - skipping buggy timezones
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/settings/func.inc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 48d1d5a0b..d2db1dfdd 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -186,11 +186,14 @@ function rcmail_user_prefs($current=null) $now = new DateTime(); foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { - $tz = new DateTimeZone($tzs); - $date = new DateTime('2012-12-21', $tz); - $offset = $date->format('Z') + 45000; - $sortkey = sprintf('%06d.%s', $offset, $tzs); - $zones[$sortkey] = array($tzs, $date->format('P')); + try { + $tz = new DateTimeZone($tzs); + $date = new DateTime('2012-12-21', $tz); + $offset = $date->format('Z') + 45000; + $sortkey = sprintf('%06d.%s', $offset, $tzs); + $zones[$sortkey] = array($tzs, $date->format('P')); + } + catch (Exception $e) {} } ksort($zones); |