[Pkg-owncloud-commits] [php-sabredav] 07/09: Not overwriting properties that were already set

David Prévot taffit at moszumanska.debian.org
Mon Jun 1 22:42:45 UTC 2015


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

taffit pushed a commit to tag 3.0.0-beta2
in repository php-sabredav.

commit 5088dbd335ea55bc79b74d95bfa6bd3d49bd3e00
Author: Evert Pot <me at evertpot.com>
Date:   Tue May 26 13:53:52 2015 -0400

    Not overwriting properties that were already set
---
 CHANGELOG.md           | 1 +
 lib/DAV/CorePlugin.php | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5eda377..2bc0e9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@ ChangeLog
 3.0.0-beta2 (2015-??-??)
 ------------------------
 
+* A node's properties should not overwrite properties that were already set.
 * Some uris were not correctly encoded in notifications.
 
 
diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index 6a4c247..6347f2a 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -841,9 +841,10 @@ class CorePlugin extends ServerPlugin {
         if ($node instanceof IProperties && $propertyNames = $propFind->get404Properties()) {
 
             $nodeProperties = $node->getProperties($propertyNames);
-
-            foreach ($nodeProperties as $propertyName => $value) {
-                $propFind->set($propertyName, $value, 200);
+            foreach($propertyNames as $propertyName) {
+                if (array_key_exists($propertyName, $nodeProperties)) {
+                    $propFind->set($propertyName, $nodeProperties[$propertyName], 200);
+                }
             }
 
         }

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