mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
when reading an empty file getting EOF is not an error
will allow uploading empty files via bulk upload Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
57b0bf316f
commit
4850828839
1 changed files with 6 additions and 2 deletions
|
|
@ -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.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue