diff --git a/emhttp/plugins/dynamix/include/Syslog.php b/emhttp/plugins/dynamix/include/Syslog.php index 32b7f3a5a..247d6d51a 100644 --- a/emhttp/plugins/dynamix/include/Syslog.php +++ b/emhttp/plugins/dynamix/include/Syslog.php @@ -1,4 +1,4 @@ - - 0 && $max < $sum - $row++) continue; - $span = ''; - foreach ($match as $type) foreach ($type['text'] as $text) if (preg_match("/$text/i",$line)) { - $span = ''; - break 2; - } - echo $span,htmlspecialchars($line),""; - } - fclose($fh); + $fh = fopen($log, 'r'); + if ($fh === false) { + continue; + } + + while (($line = fgets($fh)) !== false) { + if ($max > 0 && $max < $sum - $row++) { + continue; + } + $span = ''; + foreach ($match as $type) { + foreach ($type['text'] as $text) { + if (preg_match("/$text/i", $line)) { + $span = ''; + break 2; + } + } + } + echo $span, htmlspecialchars($line), ""; + } + fclose($fh); } + +ini_restore('memory_limit'); /* Restore original memory limit */ ?>