[Pkg-owncloud-commits] [php-sabredav] 35/163: Fix for #428 on master.
David Prévot
taffit at moszumanska.debian.org
Tue May 20 18:54:51 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 3b8ce85dc8462e3d9f5502d46748349d7dacaed4
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Fri Apr 4 16:51:36 2014 -0400
Fix for #428 on master.
---
ChangeLog.md | 1 +
lib/Sabre/DAV/Server.php | 2 +-
tests/Sabre/DAV/Locks/PluginTest.php | 5 ++---
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ChangeLog.md b/ChangeLog.md
index d074b30..71c8c5b 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -8,6 +8,7 @@ ChangeLog
home is located.
* Fixed: Issue #422 Preconditions were not being set on PUT on non-existant
files. Not really a chance for data-loss, but incorrect nevertheless.
+* Fixed: Issue #428: Etag check with If: fails if the target is a collection.
1.9.0-alpha2 (2014-01-14)
-------------------------
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php
index b14bb65..588feca 100644
--- a/lib/Sabre/DAV/Server.php
+++ b/lib/Sabre/DAV/Server.php
@@ -1621,7 +1621,7 @@ class Server extends EventEmitter {
// The token was valid, and there was an etag.. We must
// grab the current etag and check it.
$node = $this->tree->getNodeForPath($uri);
- $etagValid = $node->getETag() == $token['etag'];
+ $etagValid = $node instanceof IFile && $node->getETag() == $token['etag'];
}
diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php
index e92f86f..71f0924 100644
--- a/tests/Sabre/DAV/Locks/PluginTest.php
+++ b/tests/Sabre/DAV/Locks/PluginTest.php
@@ -929,12 +929,11 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'DELETE',
'HTTP_IF' => '(["etag1"])',
);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
- $request = new HTTP\Request($serverVars);
- $request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('HTTP/1.1 412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
}
--
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