summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@netgate.com>2019-05-20 11:35:35 -0400
committerjim-p <jimp@netgate.com>2019-05-20 11:35:35 -0400
commit303641f8283016a88f53c7743c962e16ba683579 (patch)
tree4a1ff6ad50d5ff613392a3564141c95930fd03f4
parent2bf6d4322622765bd1ce6ca8915ff75890885566 (diff)
downloadpfsense-303641f8283016a88f53c7743c962e16ba683579.zip
pfsense-303641f8283016a88f53c7743c962e16ba683579.tar.gz
Fix a potential source of PHP errors when saving per-log settings. Fixes #9540
While here, fix save descriptions.
-rw-r--r--src/usr/local/www/status_logs_common.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/usr/local/www/status_logs_common.inc b/src/usr/local/www/status_logs_common.inc
index bbd3048..d761ced 100644
--- a/src/usr/local/www/status_logs_common.inc
+++ b/src/usr/local/www/status_logs_common.inc
@@ -584,11 +584,12 @@ function manage_log_code() {
return;
}
- global $logfile, $specific_log, $config, $pconfig, $save_settings, $input_errors, $extra_save_msg, $retval, $changes_applied;
+ global $logfile, $specific_log, $config, $pconfig, $save_settings, $input_errors, $extra_save_msg, $retval, $changes_applied, $allowed_logs;
$changes_applied = false;
$extra_save_msg = "";
$specific_log = basename($logfile) . '_settings';
+ init_config_arr(array('syslog', $specific_log));
// Common to All Logs
$pconfig['cronorder'] = $config['syslog'][$specific_log]['cronorder'];
@@ -720,11 +721,12 @@ function manage_log_code() {
$changes_applied = true;
// If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
+ $log_friendly_name = empty($allowed_logs[$logfile]["name"]) ? $logfile : $allowed_logs[$logfile]["name"];
if ($logging_changed) {
- write_config($desc = gettext("Log Display Settings Saved: ") . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
+ write_config($desc = gettext("Log Display Settings Saved: ") . gettext($log_friendly_name), $backup = true, $write_config_only = false);
system_syslogd_start();
} else {
- write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
+ write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($log_friendly_name), $backup = false, $write_config_only = true);
}
// Specific to System General (main) Log
OpenPOWER on IntegriCloud