summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring/libcalendaring.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-10-16 09:43:31 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-10-16 09:43:31 (GMT)
commit5c6a5287f00e68958180442f135a7caf9ed5fb86 (patch)
tree45db1987ffa48df2e089f39f92935ba9f859193d /plugins/libcalendaring/libcalendaring.php
parent16fc7aef10c9cde3e326319652fb3893d26d7480 (diff)
downloadroundcubemail-plugins-kolab-5c6a5287f00e68958180442f135a7caf9ed5fb86.tar.gz
Catch exception when timezone is invalid
Diffstat (limited to 'plugins/libcalendaring/libcalendaring.php')
-rw-r--r--plugins/libcalendaring/libcalendaring.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 9df9e00..47cf67e 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -75,10 +75,17 @@ class libcalendaring extends rcube_plugin
$this->rc = rcube::get_instance();
// set user's timezone
- $this->timezone = new DateTimeZone($this->rc->config->get('timezone', 'GMT'));
+ try {
+ $this->timezone = new DateTimeZone($this->rc->config->get('timezone', 'GMT'));
+ }
+ catch (Exception $e) {
+ $this->timezone = new DateTimeZone('GMT');
+ }
+
$now = new DateTime('now', $this->timezone);
- $this->gmt_offset = $now->getOffset();
- $this->dst_active = $now->format('I');
+
+ $this->gmt_offset = $now->getOffset();
+ $this->dst_active = $now->format('I');
$this->timezone_offset = $this->gmt_offset / 3600 - $this->dst_active;
$this->add_texts('localization/', false);