alecpl
2012-01-06 e86a21bd83a0ae6cadfe9c919582951f306d3b64
- Fix typo in timezone handling, more exception catching


2 files modified
10 ■■■■ changed files
program/include/main.inc 2 ●●● patch | view | raw | blame | history
program/include/rcube_config.php 8 ●●●● patch | view | raw | blame | history
program/include/main.inc
@@ -1072,7 +1072,7 @@
  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());
program/include/rcube_config.php
@@ -254,10 +254,14 @@
     */
    public function get_timezone()
    {
      if ($this->get('timezone')) {
        $tz = new DateTimeZone($this->get('timezone'));
      if ($tz = $this->get('timezone')) {
        try {
          $tz = new DateTimeZone($tz);
        return $tz->getOffset(new DateTime('now')) / 3600;
      }
        catch (Exception $e) {
        }
      }
      return 0;
    }