Commit f3d70b41 authored by Franco Fichtner's avatar Franco Fichtner

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.

(cherry picked from commit 32f2ddbc)
parent cffe9236
......@@ -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 .= "<br />" . gettext("You can also <a href=\"status_filter_reload.php\">monitor</a> the filter reload progress.");
}
return $to_return;
return gettext('The changes have been applied successfully.');
}
function get_specialnets($only_enabled=false)
......
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment