diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-09 10:20:11 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-09 11:56:41 -0200 |
commit | eaa55106831046f238b9097d6b1115e5db9a455d (patch) | |
tree | 6b0fe990cc3c8b7020d6ef17e876cbd108effeac /src/usr/local/www/crash_reporter.php | |
parent | 66dba4d7d5b5076610545680fa132a73efbd5ed0 (diff) | |
download | pfsense-eaa55106831046f238b9097d6b1115e5db9a455d.zip pfsense-eaa55106831046f238b9097d6b1115e5db9a455d.tar.gz |
Crash Reporter report when no data found
The glob for $crash_files always returns an array - an empty one in the case when there are no matching crash files. So the echo at old line 115 never happened. In any case, if the echo happens, it is spat out as plain text on the GUI outside of all the nice boxes and menus.
Might be nice for the devs to get explicit feedback about the "missing" parts of a crash report - that there were either "No PHP errors found" or "No FreeBSD crash data found".
(cherry picked from commit cb6b7189bed635976ff33377e68f54b36b2647c9)
Diffstat (limited to 'src/usr/local/www/crash_reporter.php')
-rw-r--r-- | src/usr/local/www/crash_reporter.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr/local/www/crash_reporter.php b/src/usr/local/www/crash_reporter.php index fe667af..d674440 100644 --- a/src/usr/local/www/crash_reporter.php +++ b/src/usr/local/www/crash_reporter.php @@ -135,8 +135,10 @@ exec("/bin/cat /tmp/PHP_errors.log", $php_errors); if (count($php_errors) > 0) { $crash_reports .= "\nPHP Errors:\n"; $crash_reports .= implode("\n", $php_errors) . "\n\n"; + } else { + $crash_reports .= "\nNo PHP errors found.\n"; } - if (is_array($crash_files)) { + if (count($crash_files) > 0) { foreach ($crash_files as $cf) { if (filesize($cf) < FILE_SIZE) { $crash_reports .= "\nFilename: {$cf}\n"; @@ -144,7 +146,7 @@ exec("/bin/cat /tmp/PHP_errors.log", $php_errors); } } } else { - echo gettext("Could not locate any crash data."); + $crash_reports .= "\nNo FreeBSD crash data found.\n"; } ?> <div class="panel panel-default"> |