From 2ffcff228cca38fa48f73ca9bfb98115a0fb198d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Fri, 12 Sep 2014 21:53:28 +0200 Subject: [PATCH] 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 ece6885f24f..9b9a4596542 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 -- 2.39.5