diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-11-08 18:38:44 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-12-05 12:10:39 +0100 |
commit | f89ef392b32012c80a0b04e4a14f9366169b5a57 (patch) | |
tree | 42867513503f2e31a98baf80c45f874bc662dfa2 /apps/dav | |
parent | 431ac74d788535c29c97a6f7f9746b16af37afa8 (diff) | |
download | nextcloud-server-f89ef392b32012c80a0b04e4a14f9366169b5a57.tar.gz nextcloud-server-f89ef392b32012c80a0b04e4a14f9366169b5a57.zip |
fix(files): better upload error handling
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/QuotaPlugin.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index ddf4b2773e0..1eed3d0d778 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -193,6 +193,8 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { $parentPath = ''; } $req = $this->server->httpRequest; + + // If chunked upload if ($req->getHeader('OC-Chunked')) { $info = \OC_FileChunking::decodeName($newName); $chunkHandler = $this->getFileChunking($info); @@ -202,6 +204,10 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { // use target file name for free space check in case of shared files $path = rtrim($parentPath, '/') . '/' . $info['name']; } + + // Strip any duplicate slashes + $path = str_replace('//', '/', $path); + $freeSpace = $this->getFreeSpace($path); if ($freeSpace >= 0 && $length > $freeSpace) { if (isset($chunkHandler)) { |