Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Properly end iterating over the file once the target has been reached
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Feb 26, 2021
commit 19eb48b8a3597943d5d677d8caf318392613d86b
2 changes: 1 addition & 1 deletion lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public function readfilePart($path, $from, $to) {
// forward file handle via chunked fread because fseek seem to have failed

$end = $from + 1;
while (!feof($handle) && ftell($handle) < $end) {
while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) {
$len = $from - ftell($handle);
if ($len > $chunkSize) {
$len = $chunkSize;
Expand Down