Aleksander Machniak
2012-05-26 476fa983c0b8c64c8a28606a1897049e75f4e061
Catch DateTime* exceptions (#1488497) - skipping buggy timezones
1 files modified
3 ■■■■■ changed files
program/steps/settings/func.inc 3 ●●●●● patch | view | raw | blame | history
program/steps/settings/func.inc
@@ -183,12 +183,15 @@
      $now = new DateTime();
      foreach (DateTimeZone::listIdentifiers() as $i => $tzs) {
        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);
      foreach ($zones as $zone) {