From: Côme Chilliet Date: Tue, 19 Mar 2024 16:25:40 +0000 (+0100) Subject: fix(dav): Fix quota check for chunk upload X-Git-Tag: v29.0.0rc2~7^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ae7105b99020429bec76b289d656d2c2c1e402cb;p=nextcloud-server.git fix(dav): Fix quota check for chunk upload Do not ignore OC-Total-Length when Content-Length and X-Expected-Entity-Length are missing Signed-off-by: Côme Chilliet --- diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index 687b05e86cb..b37325430e7 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -250,11 +250,13 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { } $ocLength = $req->getHeader('OC-Total-Length'); - if (is_numeric($length) && is_numeric($ocLength)) { - return max($length, $ocLength); + if (!is_numeric($ocLength)) { + return $length; } - - return $length; + if (!is_numeric($length)) { + return $ocLength; + } + return max($length, $ocLength); } /**