[Pkg-owncloud-commits] [php-sabre-vobject] 09/46: Fix issue #259: add missing date format change in Recur object

David Prévot taffit at moszumanska.debian.org
Thu Dec 10 02:12:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 3d45bcbdebb3ea43172d52556ddea679a9b60df4
Author: Graham Crosmarie <gcrosmarie at linagora.com>
Date:   Wed Oct 21 15:21:28 2015 +0200

    Fix issue #259: add missing date format change in Recur object
---
 lib/Property/ICalendar/Recur.php |  3 +++
 tests/VObject/Issue259Test.php   | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/lib/Property/ICalendar/Recur.php b/lib/Property/ICalendar/Recur.php
index 6356d8e..a802aa6 100644
--- a/lib/Property/ICalendar/Recur.php
+++ b/lib/Property/ICalendar/Recur.php
@@ -51,6 +51,9 @@ class Recur extends Property {
                     if (strpos($v, ',') !== false) {
                         $v = explode(',', $v);
                     }
+                    if (strcmp($k, 'until') === 0) {
+                        $v = strtr($v, [':' => '', '-' => '']);
+                    }
                 } else {
                     $v = array_map('strtoupper', $v);
                 }
diff --git a/tests/VObject/Issue259Test.php b/tests/VObject/Issue259Test.php
new file mode 100644
index 0000000..4a73be5
--- /dev/null
+++ b/tests/VObject/Issue259Test.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Sabre\VObject;
+
+class Issue259Test extends \PHPUnit_Framework_TestCase {
+
+    function testParsingJcalWithUntil() {
+        $jcalWithUntil = '["vcalendar",[],[["vevent",[["uid",{},"text","dd1f7d29"],["organizer",{"cn":"robert"},"cal-address","mailto:robert at robert.com"],["dtstart",{"tzid":"Europe/Berlin"},"date-time","2015-10-21T12:00:00"],["dtend",{"tzid":"Europe/Berlin"},"date-time","2015-10-21T13:00:00"],["transp",{},"text","OPAQUE"],["rrule",{},"recur",{"freq":"MONTHLY","until":"2016-01-01T22:00:00Z"}]],[]]]]';
+        $parser = new Parser\Json();
+        $parser->setInput($jcalWithUntil);
+
+        $vcalendar = $parser->parse();
+        $eventAsArray = $vcalendar->select('VEVENT');
+        $event = reset($eventAsArray);
+        $rruleAsArray = $event->select('RRULE');
+        $rrule = reset($rruleAsArray);
+        $this->assertNotNull($rrule);
+        $this->assertEquals($rrule->getValue(), 'FREQ=MONTHLY;UNTIL=20160101T220000Z');
+    }
+
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list