[Pkg-owncloud-commits] [php-sabre-vobject] 142/341: Fix a bug when unserializing a <period /> to xCal.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:42 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 58b6119b445e1a4c834147903768eb45a7964062
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Fri Jan 16 11:17:04 2015 +0100

    Fix a bug when unserializing a <period /> to xCal.
---
 lib/Property/ICalendar/Period.php | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lib/Property/ICalendar/Period.php b/lib/Property/ICalendar/Period.php
index d98939c..1b4ef0f 100644
--- a/lib/Property/ICalendar/Period.php
+++ b/lib/Property/ICalendar/Period.php
@@ -139,4 +139,30 @@ class Period extends Property {
 
     }
 
+    /**
+     * Returns the value, in the format it should be encoded for XML.
+     *
+     * This method must always return an array.
+     *
+     * @return array
+     */
+    public function getXmlValue() {
+
+        $val = $this->getJsonValue();
+
+        return [
+            [
+                [
+                    'name' => 'start',
+                    'value' => $val[0][0]
+                ],
+                [
+                    'name' => $val[0][1][0] === 'P' ? 'duration' : 'end',
+                    'value' => $val[0][1]
+                ]
+            ]
+        ];
+
+    }
+
 }

-- 
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