Changeset 5733 in subversion


Ignore:
Timestamp:
Jan 6, 2012 5:55:07 AM (17 months ago)
Author:
alec
Message:
  • Fix typo in timezone handling, more exception catching
Location:
trunk/roundcubemail/program/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/main.inc

    r5732 r5733  
    10731073    // convert to the right timezone 
    10741074    $stz = date_default_timezone_get(); 
    1075     $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezones') : 'GMT'); 
     1075    $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezone') : 'GMT'); 
    10761076    $date->setTimezone($tz); 
    10771077    date_default_timezone_set($tz->getName()); 
  • trunk/roundcubemail/program/include/rcube_config.php

    r5714 r5733  
    255255    public function get_timezone() 
    256256    { 
    257       if ($this->get('timezone')) { 
    258         $tz = new DateTimeZone($this->get('timezone')); 
    259         return $tz->getOffset(new DateTime('now')) / 3600; 
     257      if ($tz = $this->get('timezone')) { 
     258        try { 
     259          $tz = new DateTimeZone($tz); 
     260          return $tz->getOffset(new DateTime('now')) / 3600; 
     261        } 
     262        catch (Exception $e) { 
     263        } 
    260264      } 
    261265 
Note: See TracChangeset for help on using the changeset viewer.