summaryrefslogtreecommitdiffstats
path: root/usr/local/www/crash_reporter.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-11-23 10:18:29 -0500
committerjim-p <jimp@pfsense.org>2011-11-23 10:23:36 -0500
commitdc43ff1eaa74ddbdc8fbdf4b088cbd487631e8c7 (patch)
treede84c4a5eecb34cb10c43ec99a35024864268314 /usr/local/www/crash_reporter.php
parent96f9e3fab1277ef03c1e4190d76b2c72666bd9c2 (diff)
downloadpfsense-dc43ff1eaa74ddbdc8fbdf4b088cbd487631e8c7.zip
pfsense-dc43ff1eaa74ddbdc8fbdf4b088cbd487631e8c7.tar.gz
Show the PHP errors reported on the index page in the crash report so users are not confused by an empty report screen. Include them in the report and also clear them after sending.
Diffstat (limited to 'usr/local/www/crash_reporter.php')
-rwxr-xr-xusr/local/www/crash_reporter.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php
index 924532c..a8d1345 100755
--- a/usr/local/www/crash_reporter.php
+++ b/usr/local/www/crash_reporter.php
@@ -88,6 +88,8 @@ $crash_report_header .= php_uname("r") . "\n";
$crash_report_header .= php_uname("v") . "\n";
$crash_report_header .= "\nCrash report details:\n";
+exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -100,9 +102,9 @@ $crash_report_header .= "\nCrash report details:\n";
if (gettext($_POST['Submit']) == "Yes") {
echo gettext("Processing...");
file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header);
- exec("/usr/bin/gzip /var/crash/*");
if(file_exists("/tmp/PHP_errors.log"))
exec("cp /tmp/PHP_errors.log /var/crash/");
+ exec("/usr/bin/gzip /var/crash/*");
$files_to_upload = glob("/var/crash/*");
echo "<p/>";
echo gettext("Uploading...");
@@ -111,6 +113,8 @@ $crash_report_header .= "\nCrash report details:\n";
if(is_array($files_to_upload)) {
$resp = upload_crash_report($files_to_upload);
exec("rm /var/crash/*");
+ // Erase the contents of the PHP error log
+ fclose(fopen("/tmp/PHP_errors.log", 'w'));
echo "<p/>";
print_r($resp);
echo "<p/><a href='/'>" . gettext("Continue") . "</a>" . gettext(" and delete crash report files from local disk.");
@@ -124,6 +128,10 @@ $crash_report_header .= "\nCrash report details:\n";
} else {
$crash_files = glob("/var/crash/*");
$crash_reports = $crash_report_header;
+ if (count($php_errors) > 0) {
+ $crash_reports .= "\nPHP Errors:\n";
+ $crash_reports .= implode("\n", $php_errors) . "\n\n";
+ }
if(is_array($crash_files)) {
foreach($crash_files as $cf) {
if(filesize($cf) < FILE_SIZE) {
OpenPOWER on IntegriCloud