aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2023-07-20 15:49:09 +0200
committerGitHub <noreply@github.com>2023-07-20 15:49:09 +0200
commitec4ae84f965ec478579d8784cb31e5aad46865bc (patch)
treed5628de669882fe583931a1cb0f280243a0b3b74
parenta4dd35e4429e69ab0b6999aef54c6eb0360f395b (diff)
parent906a6612e497178e77fe9c780840ea3c6baf5e4c (diff)
downloadnextcloud-server-ec4ae84f965ec478579d8784cb31e5aad46865bc.tar.gz
nextcloud-server-ec4ae84f965ec478579d8784cb31e5aad46865bc.zip
Merge pull request #39221 from nextcloud/bugfix/bulkUploadEmptyFiles
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.");
}