[Pkg-owncloud-commits] [php-sabredav] 114/163: Some tweaks suggested by @staabm

David Prévot taffit at moszumanska.debian.org
Tue May 20 18:55:00 UTC 2014


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

taffit pushed a commit to annotated tag upstream/2.0.0_beta1
in repository php-sabredav.

commit e3f394c50a13c4b060996572fd16cbae2d08cfde
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sat May 3 15:05:52 2014 -0400

    Some tweaks suggested by @staabm
---
 lib/Sabre/DAV/CorePlugin.php | 2 ++
 lib/Sabre/DAV/PropFind.php   | 6 +++---
 lib/Sabre/DAV/Server.php     | 9 +++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/Sabre/DAV/CorePlugin.php b/lib/Sabre/DAV/CorePlugin.php
index 1096a7f..265e011 100644
--- a/lib/Sabre/DAV/CorePlugin.php
+++ b/lib/Sabre/DAV/CorePlugin.php
@@ -727,6 +727,7 @@ class CorePlugin extends ServerPlugin {
      * Here we check if a user attempted to update a protected property and
      * ensure that the process fails if this is the case.
      *
+     * @param string $path
      * @param PropPatch $propPatch
      * @return void
      */
@@ -752,6 +753,7 @@ class CorePlugin extends ServerPlugin {
      * Here we check if a node implements IProperties and let the node handle
      * updating of (some) properties.
      *
+     * @param string $path
      * @param PropPatch $propPatch
      * @return void
      */
diff --git a/lib/Sabre/DAV/PropFind.php b/lib/Sabre/DAV/PropFind.php
index b918050..9fc200a 100644
--- a/lib/Sabre/DAV/PropFind.php
+++ b/lib/Sabre/DAV/PropFind.php
@@ -121,10 +121,10 @@ class PropFind {
      */
     public function set($propertyName, $value, $status = null) {
 
-        if (is_null($status)) {
-            $status = is_null($value) ? 404 : 200;
-        }
         if (isset($this->result[$propertyName])) {
+            if (is_null($status)) {
+                $status = is_null($value) ? 404 : 200;
+            }
             if ($status!==404 && $this->result[$propertyName][0]===404) {
                 $this->itemsLeft--;
             } elseif ($status === 404 && $this->result[$propertyName][0] !== 404) {
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php
index 28b1f70..329190c 100644
--- a/lib/Sabre/DAV/Server.php
+++ b/lib/Sabre/DAV/Server.php
@@ -925,16 +925,17 @@ class Server extends EventEmitter {
 
         foreach($propFindRequests as $propFindRequest) {
 
-            $r = $this->getPropertiesByNode($propFindRequest[0], $propFindRequest[1]);
+            list($propFind, $node) = $propFindRequest;
+            $r = $this->getPropertiesByNode($propFind, $node);
             if ($r) {
-                $result = $propFindRequest[0]->getResultForMultiStatus();
-                $result['href'] = $propFindRequest[0]->getPath();
+                $result = $propFind->getResultForMultiStatus();
+                $result['href'] = $propFind->getPath();
 
                 // WebDAV recommends adding a slash to the path, if the path is
                 // a collection.
                 // Furthermore, iCal also demands this to be the case for
                 // principals. This is non-standard, but we support it.
-                $resourceType = $this->getResourceTypeForNode($propFindRequest[1]);
+                $resourceType = $this->getResourceTypeForNode($node);
                 if (in_array('{DAV:}collection', $resourceType) || in_array('{DAV:}principal', $resourceType)) {
                     $result['href'].='/';
                 }

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