Properly end iterating over the file once the target has been reached

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2021-02-26 11:12:20 +01:00 committed by backportbot[bot]
parent b2072cd6fc
commit fc2e09b667
1 changed files with 1 additions and 1 deletions

View File

@ -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;