summaryrefslogtreecommitdiff
path: root/program/steps/settings/func.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-26 10:30:24 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-26 10:30:24 +0200
commit476fa983c0b8c64c8a28606a1897049e75f4e061 (patch)
tree866aba14fbc017866029a08e7440f5bb27bfede6 /program/steps/settings/func.inc
parent4a5c1f53752008b1789cdef224199615bbaab3fc (diff)
Catch DateTime* exceptions (#1488497) - skipping buggy timezones
Diffstat (limited to 'program/steps/settings/func.inc')
-rw-r--r--program/steps/settings/func.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 5b9ad2601..da60fea7b 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -183,11 +183,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);