[Pkg-owncloud-commits] [php-sabredav] 11/42: Don't return 404 properties on an allprops request.

David Prévot taffit at moszumanska.debian.org
Wed Jul 23 16:41:24 UTC 2014


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

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

commit ce1b61b7ad3a8e039b0fd9c221457b4f86fa352a
Author: Evert Pot <me at evertpot.com>
Date:   Wed May 28 10:50:46 2014 -0400

    Don't return 404 properties on an allprops request.
    
    See #464
---
 ChangeLog.md                     | 5 +++++
 lib/DAV/PropFind.php             | 2 ++
 tests/Sabre/DAV/PropFindTest.php | 9 ---------
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 10cb398..5fb60af 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -2,8 +2,13 @@ ChangeLog
 =========
 
 2.0.1 (2014-??-??)
+------------------
+
 * #459: PROPFIND requests on Files with no Depth header would return a fatal
   error.
+* #464: A PROPFIND allprops request should not return properties with status
+  404.
+
 
 2.0.0 (2014-05-22)
 ------------------
diff --git a/lib/DAV/PropFind.php b/lib/DAV/PropFind.php
index 0881e2a..118ece5 100644
--- a/lib/DAV/PropFind.php
+++ b/lib/DAV/PropFind.php
@@ -266,6 +266,8 @@ class PropFind {
                 $r[$info[0]][$propertyName] = $info[1];
             }
         }
+        // Removing the 404's for multi-status requests.
+        if ($this->requestType === self::ALLPROPS) unset($r[404]);
         return $r;
 
     }
diff --git a/tests/Sabre/DAV/PropFindTest.php b/tests/Sabre/DAV/PropFindTest.php
index f2ef2d6..51fd71c 100644
--- a/tests/Sabre/DAV/PropFindTest.php
+++ b/tests/Sabre/DAV/PropFindTest.php
@@ -34,15 +34,6 @@ class PropFindTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals([
             200 => [],
-            404 => [
-                '{DAV:}getlastmodified' => null,
-                '{DAV:}getcontentlength' => null,
-                '{DAV:}resourcetype' => null,
-                '{DAV:}quota-used-bytes' => null,
-                '{DAV:}quota-available-bytes' => null,
-                '{DAV:}getetag' => null,
-                '{DAV:}getcontenttype' => null,
-            ],
         ], $propFind->getResultForMultiStatus());
 
     }

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



More information about the Pkg-owncloud-commits mailing list