Merge pull request #26376 from nextcloud/backport/25804/stable21
[stable21] Do not attempt to read 0 bytes when manually iterating over a non-seekable file
This commit is contained in:
commit
00daf58da8
|
@ -456,7 +456,7 @@ class View {
|
||||||
// forward file handle via chunked fread because fseek seem to have failed
|
// forward file handle via chunked fread because fseek seem to have failed
|
||||||
|
|
||||||
$end = $from + 1;
|
$end = $from + 1;
|
||||||
while (!feof($handle) && ftell($handle) < $end) {
|
while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) {
|
||||||
$len = $from - ftell($handle);
|
$len = $from - ftell($handle);
|
||||||
if ($len > $chunkSize) {
|
if ($len > $chunkSize) {
|
||||||
$len = $chunkSize;
|
$len = $chunkSize;
|
||||||
|
|
Loading…
Reference in New Issue