summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-09-04 07:03:31 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-09-04 07:03:31 (GMT)
commit164fae83877ea6ab307665d9747a67298cca200b (patch)
tree38b957ac93cccf79eef5a7d195163456d7412bc8 /plugins
parent59c35a746f81e4cf42d546a615ecba5b9e05449c (diff)
parentea949c79923dbb975b12da0dea0c7f899354e78b (diff)
downloadroundcubemail-plugins-kolab-164fae83877ea6ab307665d9747a67298cca200b.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/roundcubemail-plugins-kolab
Diffstat (limited to 'plugins')
-rw-r--r--plugins/calendar/calendar.php3
-rw-r--r--plugins/libcalendaring/libcalendaring.php5
-rw-r--r--plugins/libcalendaring/libvcalendar.php20
3 files changed, 20 insertions, 8 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 5c866da..3b8728a 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1205,7 +1205,8 @@ class calendar extends rcube_plugin
'_id' => $event['calendar'] . ':' . $event['id'], // unique identifier for fullcalendar
'start' => $this->lib->adjust_timezone($event['start'])->format('c'),
'end' => $this->lib->adjust_timezone($event['end'])->format('c'),
- 'changed' => $this->lib->adjust_timezone($event['changed'])->format('c'),
+ // 'changed' might be empty for event recurrences (Bug #2185)
+ 'changed' => $event['changed'] ? $this->lib->adjust_timezone($event['changed'])->format('c') : null,
'title' => strval($event['title']),
'description' => strval($event['description']),
'location' => strval($event['location']),
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 31b731d..608a527 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -120,7 +120,10 @@ class libcalendaring extends rcube_plugin
else if (is_string($dt))
$dt = new DateTime($dt);
- $dt->setTimezone($this->timezone);
+ if ($dt instanceof DateTime) {
+ $dt->setTimezone($this->timezone);
+ }
+
return $dt;
}
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 998ed13..5776af5 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -108,7 +108,6 @@ class libvcalendar
return $this->import_from_vobject($vobject);
}
catch (Exception $e) {
- throw $e;
rcube::raise_error(array(
'code' => 600, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
@@ -206,19 +205,28 @@ class libvcalendar
$event = array(
'uid' => strval($ve->UID),
'title' => strval($ve->SUMMARY),
- 'created' => $ve->CREATED ? $ve->CREATED->getDateTime() : null,
- 'changed' => null,
'_type' => $ve->name == 'VTODO' ? 'task' : 'event',
// set defaults
'priority' => 0,
'attendees' => array(),
);
+ // Catch possible exceptions when date is invalid (Bug #2144)
+ // We can skip these fields, they aren't critical
+ if ($ve->CREATED) {
+ try {
+ $event['created'] = $ve->CREATED->getDateTime();
+ } catch (Exception $e) {};
+ }
if ($ve->{'LAST-MODIFIED'}) {
- $event['changed'] = $ve->{'LAST-MODIFIED'}->getDateTime();
+ try {
+ $event['changed'] = $ve->{'LAST-MODIFIED'}->getDateTime();
+ } catch (Exception $e) {};
}
- else if ($ve->DTSTAMP) {
- $event['changed'] = $ve->DTSTAMP->getDateTime();
+ if (!$event['changed'] && $ve->DTSTAMP) {
+ try {
+ $event['changed'] = $ve->DTSTAMP->getDateTime();
+ } catch (Exception $e) {};
}
// map other attributes to internal fields