From fc2e09b66743a12ed2c1a885a21640d7274d6e99 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Fri, 26 Feb 2021 11:12:20 +0100 Subject: Properly end iterating over the file once the target has been reached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Files/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/Files/View.php') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 1bee09e3659..ed7d6c26318 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -456,7 +456,7 @@ class View { // 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; -- cgit v1.2.3