From b724e2e4348fef655167de25209621df91e53677 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 10 Jun 2022 14:35:05 +0200 Subject: [PATCH] firmware: disable crash reporter submission on non-production deployment Just fiddling with the soon to be replaced functionality. Remove the pedantic check so we can see everything even from the dashboard hint. --- src/www/crash_reporter.php | 26 ++++++++++++++++++-------- src/www/guiconfig.inc | 16 +++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/www/crash_reporter.php b/src/www/crash_reporter.php index 1aa3208fc..6cd192b1b 100644 --- a/src/www/crash_reporter.php +++ b/src/www/crash_reporter.php @@ -82,8 +82,9 @@ if (isset($_SERVER['HTTP_USER_AGENT'])) { } $user_agent = "{$g['product_name']}/{$g['product_version']}"; -$crash_reports = array(); +$crash_reports = []; $has_crashed = false; +$is_prod = empty($config['system']['deployment']); $pconfig = array(); $pconfig['Email'] = isset($config['system']['contact_email']) ? $config['system']['contact_email'] : ''; @@ -147,7 +148,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } else { /* if there is no user activity probe for a crash report */ - $has_crashed = get_crash_report(true) != ''; + $has_crashed = !empty(get_crash_report()); } if ($has_crashed) { @@ -186,7 +187,11 @@ if ($has_crashed) { $message = gettext('No issues were detected.'); if ($has_crashed) { - $message = gettext('An issue was detected.'); + if ($is_prod) { + $message = gettext('An issue was detected.'); + } else { + $message = gettext('Non-production deployment is configured so crash reports cannot be sent.'); + } } if (isset($pconfig['Submit'])) { @@ -197,7 +202,9 @@ if (isset($pconfig['Submit'])) { $message = gettext('This crash report contains no actual crash information. If you want to submit a problem please fill out your e-mail and description below.'); } } elseif ($pconfig['Submit'] == 'no') { - $message = gettext('Please consider submitting a crash report if the error persists.'); + if ($is_prod) { + $message = gettext('Please consider submitting a crash report if the error persists.'); + } } } @@ -216,17 +223,20 @@ legacy_html_escape_form_data($pconfig);
- +
+


-

+


+ +

+ $content):?>

@@ -237,7 +247,7 @@ legacy_html_escape_form_data($pconfig); endforeach; else:?> - +


0) { $count++;