summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-14 09:09:21 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-19 09:28:54 +0200
commit05223a39f9f29181c242cc6952c91b74a70c969a (patch)
tree3ed676467a3e9aaaf80c733eaa74d09182ce5835 /apps/dav/lib
parent46406f517aa7c07f148d69d69a5f61306d140ec3 (diff)
downloadnextcloud-server-05223a39f9f29181c242cc6952c91b74a70c969a.tar.gz
nextcloud-server-05223a39f9f29181c242cc6952c91b74a70c969a.zip
Make sure we only use numbers as length
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/QuotaPlugin.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
index 0682fca94ea..484bb5129e8 100644
--- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
@@ -120,12 +120,13 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
public function getLength() {
$req = $this->server->httpRequest;
$length = $req->getHeader('X-Expected-Entity-Length');
- if (!$length) {
+ if (!is_numeric($length)) {
$length = $req->getHeader('Content-Length');
+ $length = is_numeric($length) ? $length : null;
}
$ocLength = $req->getHeader('OC-Total-Length');
- if ($length && $ocLength) {
+ if (is_numeric($length) && is_numeric($ocLength)) {
return max($length, $ocLength);
}