diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-06 10:55:07 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-06 10:55:07 +0000 |
| commit | ee4efc78186507efbee9a55fc889d37ab570f199 (patch) | |
| tree | 832c3d03ab52c601e4805fdc6a0f87785a324b0b | |
| parent | efbd7fdce36f3ecbc53623eeff93b7998fcc7528 (diff) | |
- Fix typo in timezone handling, more exception catching
git-svn-id: https://svn.roundcube.net/trunk@5733 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/main.inc | 2 | ||||
| -rw-r--r-- | roundcubemail/program/include/rcube_config.php | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index f6e2ca206..148c2bd5c 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -1072,7 +1072,7 @@ function format_date($date, $format=NULL, $convert=true) try { // convert to the right timezone $stz = date_default_timezone_get(); - $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezones') : 'GMT'); + $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezone') : 'GMT'); $date->setTimezone($tz); date_default_timezone_set($tz->getName()); diff --git a/roundcubemail/program/include/rcube_config.php b/roundcubemail/program/include/rcube_config.php index e16395711..038336480 100644 --- a/roundcubemail/program/include/rcube_config.php +++ b/roundcubemail/program/include/rcube_config.php @@ -254,9 +254,13 @@ class rcube_config */ public function get_timezone() { - if ($this->get('timezone')) { - $tz = new DateTimeZone($this->get('timezone')); - return $tz->getOffset(new DateTime('now')) / 3600; + if ($tz = $this->get('timezone')) { + try { + $tz = new DateTimeZone($tz); + return $tz->getOffset(new DateTime('now')) / 3600; + } + catch (Exception $e) { + } } return 0; |
