From 32f2ddbcf442389e4a1f8aa86dc42ea3bb44c32f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 18 Apr 2017 23:59:01 +0200 Subject: [PATCH] src: show save message in correct language after language switch get_std_save_message() should be removed eventually, there are only a few callers left. Out of lack of imagintion, just fix the apparent issue and remove the attached filter/firewall message that doesn't really work because it does not look for "firewall" in the script name. --- src/www/guiconfig.inc | 17 +++++------------ src/www/system_general.php | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/www/guiconfig.inc b/src/www/guiconfig.inc index 0eab0bbb4..f9701d36f 100644 --- a/src/www/guiconfig.inc +++ b/src/www/guiconfig.inc @@ -261,20 +261,13 @@ function print_service_banner($service) } } -function get_std_save_message() +function get_std_save_message($raw = false) { - $filter_related = false; - $filter_pages = array("nat", "filter"); - $to_return = gettext("The changes have been applied successfully."); - foreach($filter_pages as $fp) { - if (stristr($_SERVER['SCRIPT_FILENAME'], $fp)) { - $filter_related = true; - } + if ($raw == true) { + return 'The changes have been applied successfully.'; } - if ($filter_related) { - $to_return .= "
" . gettext("You can also monitor the filter reload progress."); - } - return $to_return; + + return gettext('The changes have been applied successfully.'); } function get_specialnets($only_enabled=false) diff --git a/src/www/system_general.php b/src/www/system_general.php index 899f3b0d4..6770b67a6 100644 --- a/src/www/system_general.php +++ b/src/www/system_general.php @@ -37,7 +37,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); if (isset($_GET['savemsg'])) { - $savemsg = htmlspecialchars($_GET['savemsg']); + $savemsg = htmlspecialchars(gettext($_GET['savemsg'])); } $pconfig['dns1gw'] = null; @@ -229,7 +229,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { system_timezone_configure(); filter_configure(); - header(url_safe('Location: /system_general.php?savemsg=%s', array(get_std_save_message()))); + header(url_safe('Location: /system_general.php?savemsg=%s', array(get_std_save_message(true)))); exit; } }