Changeset 476fa98 in github


Ignore:
Timestamp:
May 26, 2012 4:30:24 AM (12 months ago)
Author:
Aleksander Machniak <alec@…>
Branches:
master, HEAD, dev-browser-capabilities, pdo
Children:
6d3e53d
Parents:
4a5c1f5
Message:

Catch DateTime?* exceptions (#1488497) - skipping buggy timezones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/settings/func.inc

    r041c93c r476fa98  
    184184      $now = new DateTime(); 
    185185      foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { 
    186         $tz = new DateTimeZone($tzs); 
    187         $date = new DateTime('2012-12-21', $tz); 
    188         $offset = $date->format('Z') + 45000; 
    189         $sortkey = sprintf('%06d.%s', $offset, $tzs); 
    190         $zones[$sortkey] = array($tzs, $date->format('P')); 
     186        try { 
     187          $tz = new DateTimeZone($tzs); 
     188          $date = new DateTime('2012-12-21', $tz); 
     189          $offset = $date->format('Z') + 45000; 
     190          $sortkey = sprintf('%06d.%s', $offset, $tzs); 
     191          $zones[$sortkey] = array($tzs, $date->format('P')); 
     192        } 
     193        catch (Exception $e) {} 
    191194      } 
    192195 
Note: See TracChangeset for help on using the changeset viewer.