[Pkg-owncloud-commits] [owncloud] 69/258: content size checks are not valid for LOCK

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:22 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit 2ffcff228cca38fa48f73ca9bfb98115a0fb198d
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Fri Sep 12 21:53:28 2014 +0200

    content size checks are not valid for LOCK
---
 lib/private/connector/sabre/file.php | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index ece6885..9b9a459 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -104,11 +104,13 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
 
 		// double check if the file was fully received
 		// compare expected and actual size
-		$expected = $_SERVER['CONTENT_LENGTH'];
-		$actual = $this->fileView->filesize($partFilePath);
-		if ($actual != $expected) {
-			$this->fileView->unlink($partFilePath);
-			throw new \Sabre\DAV\Exception\BadRequest('expected filesize ' . $expected . ' got ' . $actual);
+		if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] !== 'LOCK') {
+			$expected = $_SERVER['CONTENT_LENGTH'];
+			$actual = $this->fileView->filesize($partFilePath);
+			if ($actual != $expected) {
+				$this->fileView->unlink($partFilePath);
+				throw new \Sabre\DAV\Exception\BadRequest('expected filesize ' . $expected . ' got ' . $actual);
+			}
 		}
 
 		// rename to correct path

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



More information about the Pkg-owncloud-commits mailing list