summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-20 10:00:29 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-08-01 13:56:12 +0200
commit231bb47ae614eae87691327b1c5b639a105bf4bd (patch)
tree332d69450d09e74fa5efefa5b45eec1fc193d689 /apps/dav/lib
parentd703744d4afa9b387616ff6f6de574b652e125f1 (diff)
downloadnextcloud-server-231bb47ae614eae87691327b1c5b639a105bf4bd.tar.gz
nextcloud-server-231bb47ae614eae87691327b1c5b639a105bf4bd.zip
Fix file size comparison
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index 9803beabe37..478321d41f2 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -146,7 +146,7 @@ class File extends Node implements IFile {
// double check if the file was fully received
// compare expected and actual size
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
- $expected = $_SERVER['CONTENT_LENGTH'];
+ $expected = (int) $_SERVER['CONTENT_LENGTH'];
if ($count !== $expected) {
throw new BadRequest('expected filesize ' . $expected . ' got ' . $count);
}
@@ -409,7 +409,7 @@ class File extends Node implements IFile {
//detect aborted upload
if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
if (isset($_SERVER['CONTENT_LENGTH'])) {
- $expected = $_SERVER['CONTENT_LENGTH'];
+ $expected = (int) $_SERVER['CONTENT_LENGTH'];
if ($bytesWritten !== $expected) {
$chunk_handler->remove($info['index']);
throw new BadRequest(