]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(dav): Fix quota check for chunk upload
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 19 Mar 2024 16:25:40 +0000 (17:25 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 2 Apr 2024 15:45:57 +0000 (15:45 +0000)
Do not ignore OC-Total-Length when Content-Length and
 X-Expected-Entity-Length are missing

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/dav/lib/Connector/Sabre/QuotaPlugin.php

index 687b05e86cb89b96998ab1997b27f45cba459858..b37325430e74546f7962eff1b925da3b165c0577 100644 (file)
@@ -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);
        }
 
        /**