summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-07-27 10:35:20 +0200
committerGitHub <noreply@github.com>2023-07-27 10:35:20 +0200
commit3fafbf74b8e0d4effb3fd2038de0ce8c41b7f521 (patch)
tree80d2dfc415ea98c1733274ec4c9767e9f07b7208
parent115c0cfbab7b21a8bf3f0578b8473bc1c746e502 (diff)
parentf79caf2d76bf9a73a160a9d3a836770965b4f639 (diff)
downloadnextcloud-server-3fafbf74b8e0d4effb3fd2038de0ce8c41b7f521.tar.gz
nextcloud-server-3fafbf74b8e0d4effb3fd2038de0ce8c41b7f521.zip
Merge pull request #39509 from nextcloud/backport/39221/stable25
[stable25] Bugfix/bulk upload empty files
-rw-r--r--apps/dav/lib/BulkUpload/MultipartRequestParser.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php
index 7554447fc93..16c83fee64e 100644
--- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php
+++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php
@@ -211,13 +211,17 @@ class MultipartRequestParser {
throw new BadRequest("Computed md5 hash is incorrect.");
}
- $content = stream_get_line($this->stream, $length);
+ if ($length === 0) {
+ $content = '';
+ } else {
+ $content = stream_get_line($this->stream, $length);
+ }
if ($content === false) {
throw new Exception("Fail to read part's content.");
}
- if (feof($this->stream)) {
+ if ($length !== 0 && feof($this->stream)) {
throw new Exception("Unexpected EOF while reading stream.");
}