[Pkg-owncloud-commits] [php-sabre-vobject] 67/341: !xml <request-status>

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:34 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 91551e5f2a77af46106e487cc69fc82da8d57ece
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Nov 18 14:54:39 2014 +0100

    !xml <request-status>
---
 lib/Parser/XML.php | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php
index 5083071..0d4c372 100644
--- a/lib/Parser/XML.php
+++ b/lib/Parser/XML.php
@@ -96,17 +96,33 @@ class XML extends Parser {
                             array_splice($xmlProperty['value'], $i, 1);
                         }
 
-                        $propertyType  = static::getTagName($xmlProperty['value'][0]['name']);
-                        $propertyValue = $xmlProperty['value'][0]['value'];
+                        switch($propertyName) {
 
-                        $property      = $this->root->createProperty(
+                            case 'request-status':
+                                $propertyType  = 'text';
+                                $propertyValue = [];
+
+                                foreach($xmlProperty['value'] as $xmlRequestChild) {
+
+                                    $propertyValue[static::getTagName($xmlRequestChild['name'])]
+                                        = $xmlRequestChild['value'];
+                                }
+                                break;
+
+                            default:
+                                $propertyType  = static::getTagName($xmlProperty['value'][0]['name']);
+                                $propertyValue = [$xmlProperty['value'][0]['value']];
+                                break;
+                        }
+
+                        $property = $this->root->createProperty(
                             $propertyName,
                             null,
                             $propertyParameters,
                             $propertyType
                         );
                         $parentComponent->add($property);
-                        $property->setXmlValue([$propertyValue]);
+                        $property->setXmlValue($propertyValue);
                     }
                     break;
 

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