From e7794be61135b07c6227c367ebf735ba94a2b200 Mon Sep 17 00:00:00 2001 From: fiwswe <53953985+fiwswe@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:09:40 +0100 Subject: [PATCH] Fix a corner case When the log file is exactly 1 MB (MAX_READ_SIZE) In size, the first line(s) would not be shown. --- lib/plugins/logviewer/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/logviewer/admin.php b/lib/plugins/logviewer/admin.php index 8c769982e..7bcb755f4 100644 --- a/lib/plugins/logviewer/admin.php +++ b/lib/plugins/logviewer/admin.php @@ -153,7 +153,7 @@ class admin_plugin_logviewer extends DokuWiki_Admin_Plugin $lines = explode("\n", $logData); unset($logData); // free memory early - if ($toread === self::MAX_READ_SIZE) { + if ($size > self::MAX_READ_SIZE) { array_shift($lines); // Discard the first line while (!empty($lines) && (substr($lines[0], 0, 2) === ' ')) { array_shift($lines); // Discard indented lines -- 2.11.4.GIT