summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-11-09 16:13:24 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-11-09 16:13:24 (GMT)
commit4a03dd30585dfbba513d0bb4ca99e3fb90ce79a6 (patch)
tree17dc32e79cff5b7fd801d4f6b75e21faefd6d0eb
parentc30ff8e68a0c884f523b3702b53e48ba72ca1256 (diff)
downloadroundcubemail-plugins-kolab-4a03dd30585dfbba513d0bb4ca99e3fb90ce79a6.tar.gz
Fix syntax and DateTime errors according to OTRS #1000069
-rw-r--r--plugins/calendar/calendar.php4
-rw-r--r--plugins/calendar/lib/calendar_ical.php2
-rw-r--r--plugins/calendar/lib/calendar_itip.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 2ac4f4a..37a723e 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1566,8 +1566,8 @@ class calendar extends rcube_plugin
private function prepare_event(&$event, $action)
{
// convert dates into DateTime objects in user's current timezone
- $event['start'] = new DateTime($event['start'], $this->user_timezone);
- $event['end'] = new DateTime($event['end'], $this->user_timezone);
+ $event['start'] = new DateTime(is_numeric($event['start']) ? '@'.$event['start'] : $event['start'], $this->user_timezone);
+ $event['end'] = new DateTime(is_numeric($event['end']) ? '@'.$event['end'] : $event['end'], $this->user_timezone);
if ($event['recurrence']['UNTIL'])
$event['recurrence']['UNTIL'] = new DateTime($event['recurrence']['UNTIL'], $this->user_timezone);
diff --git a/plugins/calendar/lib/calendar_ical.php b/plugins/calendar/lib/calendar_ical.php
index 3f1aeda..9bd10e1 100644
--- a/plugins/calendar/lib/calendar_ical.php
+++ b/plugins/calendar/lib/calendar_ical.php
@@ -369,7 +369,7 @@ class calendar_ical
foreach ($events as $event) {
$vevent = "BEGIN:VEVENT" . self::EOL;
$vevent .= "UID:" . self::escpape($event['uid']) . self::EOL;
- $vevent .= $this->format_datetime("DTSTAMP", $event['changed'] ?: new DateTime(), false, true) . self::EOL;
+ $vevent .= $this->format_datetime("DTSTAMP", $event['changed'] ? $event['changed'] : new DateTime(), false, true) . self::EOL;
// correctly set all-day dates
if ($event['allday']) {
$event['end'] = new DateTime('@'.($event['end']->format('U') + 86400)); // ends the next day
diff --git a/plugins/calendar/lib/calendar_itip.php b/plugins/calendar/lib/calendar_itip.php
index c47d081..2d828f4 100644
--- a/plugins/calendar/lib/calendar_itip.php
+++ b/plugins/calendar/lib/calendar_itip.php
@@ -255,7 +255,7 @@ class calendar_itip
$event['uid'],
$this->rc->user->ID,
self::serialize_event($event),
- date('Y-m-d H:i:s', $event['end'] + 86400 * 2)
+ date('Y-m-d H:i:s', $event['end']->format('U') + 86400 * 2)
);
if ($this->rc->db->affected_rows($query)) {