Branch 'roundcubemail-plugins-kolab-3.1' - plugins/libcalendaring

Thomas Brüderli bruederli at kolabsys.com
Tue Oct 1 11:57:11 CEST 2013


 plugins/libcalendaring/libvcalendar.php |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d0e093652156a19caf7a410e05cc3181a5c065b7
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Oct 1 11:55:10 2013 +0200

    Set DTSTAMP according to RFC 5545, Section 3.8.7.2.: In the case of an iCalendar object that doesn't specify a 'METHOD' property, this property specifies the date and time [...] the calendar component was last revised

diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 75b071c..f64a831 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -621,6 +621,7 @@ class libvcalendar
     public function export($objects, $method = null, $write = false, $get_attachment = false, $recurrence_id = null)
     {
         $memory_limit = parse_bytes(ini_get('memory_limit'));
+        $this->method = $method;
 
         // encapsulate in VCALENDAR container
         $vcal = VObject\Component::create('VCALENDAR');
@@ -665,7 +666,10 @@ class libvcalendar
         $type = $event['_type'] ?: 'event';
         $ve = VObject\Component::create($this->type_component_map[$type]);
         $ve->add('UID', $event['uid']);
-        $ve->add(self::datetime_prop('DTSTAMP', new DateTime(), true));
+
+        // set DTSTAMP according to RFC 5545, 3.8.7.2.
+        $dtstamp = !empty($event['changed']) && !empty($this->method) ? $event['changed'] : new DateTime();
+        $ve->add(self::datetime_prop('DTSTAMP', $dtstamp, true));
 
         // all-day events end the next day
         if ($event['allday'] && !empty($event['end'])) {




More information about the commits mailing list