[Pkg-owncloud-commits] [php-sabredav] 120/220: Correct result from createCollection. Fixes MKCOL xml responses.

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:15 UTC 2016


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

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

commit d5060ad1a98a1875ebe17a91fbc011bd412a6d04
Author: Evert Pot <me at evertpot.com>
Date:   Thu Mar 31 20:11:18 2016 -0400

    Correct result from createCollection. Fixes MKCOL xml responses.
    
    Fix #751
---
 CHANGELOG.md       |  1 +
 lib/DAV/Server.php | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fc5d88..c192c23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@ ChangeLog
   quickly where a principal lives on a server.
 * Renamed `phpunit.xml` to `phpunit.xml.dist` to make local modifications easy.
 * Functionality from `IShareableCalendar` is merged into `ISharedCalendar`.
+* #751: Fixed XML responses from failing `MKCOL` requests.
 
 3.1.3 (????-??-??)
 ------------------
diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php
index b376528..7a0a9ad 100644
--- a/lib/DAV/Server.php
+++ b/lib/DAV/Server.php
@@ -1177,9 +1177,20 @@ class Server extends EventEmitter {
 
         if (!$success) {
             $result = $mkCol->getResult();
-            // generateMkCol needs the href key to exist.
-            $result['href'] = $uri;
-            return $result;
+
+            $formattedResult = [
+                'href' => $uri,
+            ];
+
+            foreach ($result as $propertyName => $status) {
+
+                if (!isset($formattedResult[$status])) {
+                    $formattedResult[$status] = [];
+                }
+                $formattedResult[$status][$propertyName] = null;
+
+            }
+            return $formattedResult;
         }
 
         $this->tree->markDirty($parentUri);

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



More information about the Pkg-owncloud-commits mailing list