Commit f39ce32b authored by Franco Fichtner's avatar Franco Fichtner

services: url_safe() for #1168

parent c5ab052b
...@@ -109,7 +109,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -109,7 +109,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config(); write_config();
services_dnsmasq_configure(); services_dnsmasq_configure();
header("Location: services_dnsmasq.php"); header(url_safe('Location: /services_dnsmasq.php'));
exit; exit;
} }
} elseif (isset($pconfig['apply'])) { } elseif (isset($pconfig['apply'])) {
...@@ -121,7 +121,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -121,7 +121,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
services_dhcpleases_configure(); services_dhcpleases_configure();
services_dnsmasq_configure(); services_dnsmasq_configure();
clear_subsystem_dirty('hosts'); clear_subsystem_dirty('hosts');
header("Location: services_dnsmasq.php"); header(url_safe('Location: /services_dnsmasq.php'));
exit; exit;
} elseif (!empty($pconfig['act']) && $pconfig['act'] == 'del') { } elseif (!empty($pconfig['act']) && $pconfig['act'] == 'del') {
$a_hosts = &$config['dnsmasq']['hosts']; $a_hosts = &$config['dnsmasq']['hosts'];
......
...@@ -117,7 +117,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -117,7 +117,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
services_dnsmasq_configure(); services_dnsmasq_configure();
write_config(); write_config();
header("Location: services_dnsmasq.php"); header(url_safe('Location: /services_dnsmasq.php'));
exit; exit;
} }
} }
......
...@@ -134,7 +134,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -134,7 +134,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
usort($config['dnsmasq']['hosts'], "hostcmp"); usort($config['dnsmasq']['hosts'], "hostcmp");
mark_subsystem_dirty('hosts'); mark_subsystem_dirty('hosts');
write_config(); write_config();
header("Location: services_dnsmasq.php"); header(url_safe('Location: /services_dnsmasq.php'));
exit; exit;
} }
} }
......
...@@ -162,7 +162,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -162,7 +162,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
services_dyndns_configure_client($dyndns); services_dyndns_configure_client($dyndns);
header("Location: services_dyndns.php"); header(url_safe('Location: /services_dyndns.php'));
exit; exit;
} }
} }
......
...@@ -51,7 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -51,7 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
/* reload all components that use igmpproxy */ /* reload all components that use igmpproxy */
services_igmpproxy_configure(); services_igmpproxy_configure();
clear_subsystem_dirty('igmpproxy'); clear_subsystem_dirty('igmpproxy');
header("Location: services_igmpproxy.php"); header(url_safe('Location: /services_igmpproxy.php'));
exit; exit;
} }
} }
......
...@@ -95,7 +95,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -95,7 +95,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
mark_subsystem_dirty('igmpproxy'); mark_subsystem_dirty('igmpproxy');
header("Location: services_igmpproxy.php"); header(url_safe('Location: /services_igmpproxy.php'));
exit; exit;
} }
} }
......
...@@ -114,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -114,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config("Updated NTP Server Settings"); write_config("Updated NTP Server Settings");
system_ntp_configure(); system_ntp_configure();
header("Location: services_ntpd.php"); header(url_safe('Location: /services_ntpd.php'));
exit; exit;
} }
} }
......
...@@ -68,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -68,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['ntpd']['gps'] = $gps; $config['ntpd']['gps'] = $gps;
write_config("Updated NTP GPS Settings"); write_config("Updated NTP GPS Settings");
system_ntp_configure(); system_ntp_configure();
header("Location: services_ntpd_gps.php"); header(url_safe('Location: /services_ntpd_gps.php'));
exit; exit;
} }
} }
......
...@@ -67,7 +67,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -67,7 +67,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['ntpd']['pps'] = $pps; $config['ntpd']['pps'] = $pps;
write_config("Updated NTP PPS Settings"); write_config("Updated NTP PPS Settings");
system_ntp_configure(); system_ntp_configure();
header("Location: services_ntpd_pps.php"); header(url_safe('Location: /services_ntpd_pps.php'));
exit; exit;
} }
} }
......
...@@ -109,7 +109,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -109,7 +109,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} else { } else {
services_dnsupdate_process(); services_dnsupdate_process();
} }
header("Location: services_rfc2136.php"); header(url_safe('Location: /services_rfc2136.php'));
exit; exit;
} }
} }
......
...@@ -117,7 +117,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -117,7 +117,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
services_snmpd_configure(); services_snmpd_configure();
get_std_save_message(); get_std_save_message();
header("Location: services_snmp.php"); header(url_safe('Location: /services_snmp.php'));
exit; exit;
} }
} }
......
...@@ -62,7 +62,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -62,7 +62,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
clear_subsystem_dirty('unbound'); clear_subsystem_dirty('unbound');
/* Update resolv.conf in case the interface bindings exclude localhost. */ /* Update resolv.conf in case the interface bindings exclude localhost. */
system_resolvconf_generate(); system_resolvconf_generate();
header("Location: services_unbound.php"); header(url_safe('Location: /services_unbound.php'));
exit; exit;
} else { } else {
// perform validations // perform validations
...@@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config("DNS Resolver configured."); write_config("DNS Resolver configured.");
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
header("Location: services_unbound.php"); header(url_safe('Location: /services_unbound.php'));
exit; exit;
} }
} }
......
...@@ -68,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -68,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['apply'])) { if (!empty($pconfig['apply'])) {
services_unbound_configure(); services_unbound_configure();
clear_subsystem_dirty('unbound'); clear_subsystem_dirty('unbound');
header("Location: services_unbound_acls.php"); header(url_safe('Location: /services_unbound_acls.php'));
exit; exit;
} elseif (!empty($act) && $act == "del") { } elseif (!empty($act) && $act == "del") {
if (isset($id) && !empty($a_acls[$id])) { if (isset($id) && !empty($a_acls[$id])) {
...@@ -112,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -112,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
mark_subsystem_dirty("unbound"); mark_subsystem_dirty("unbound");
write_config(); write_config();
header("Location: services_unbound_acls.php"); header(url_safe('Location: /services_unbound_acls.php'));
exit; exit;
} }
} }
......
...@@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($_POST['apply'])) { if (!empty($_POST['apply'])) {
services_unbound_configure(); services_unbound_configure();
clear_subsystem_dirty('unbound'); clear_subsystem_dirty('unbound');
header("Location: services_unbound_advanced.php"); header(url_safe('Location: /services_unbound_advanced.php'));
exit; exit;
} else { } else {
$pconfig = $_POST; $pconfig = $_POST;
...@@ -87,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -87,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config("DNS Resolver configured."); write_config("DNS Resolver configured.");
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
header("Location: services_unbound_advanced.php"); header(url_safe('Location: /services_unbound_advanced.php'));
exit; exit;
} }
} }
......
...@@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
write_config(); write_config();
header("Location: services_unbound_overrides.php"); header(url_safe('Location: /services_unbound_overrides.php'));
exit; exit;
} }
} }
......
...@@ -125,10 +125,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -125,10 +125,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
usort($a_hosts, "hostcmp"); usort($a_hosts, "hostcmp");
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
write_config(); write_config();
header("Location: services_unbound_overrides.php"); header(url_safe('Location: /services_unbound_overrides.php'));
exit; exit;
} }
} }
$service_hook = 'unbound'; $service_hook = 'unbound';
......
...@@ -60,7 +60,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -60,7 +60,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
clear_subsystem_dirty('unbound'); clear_subsystem_dirty('unbound');
/* Update resolv.conf in case the interface bindings exclude localhost. */ /* Update resolv.conf in case the interface bindings exclude localhost. */
system_resolvconf_generate(); system_resolvconf_generate();
header("Location: services_unbound_overrides.php"); header(url_safe('Location: /services_unbound_overrides.php'));
exit; exit;
} elseif (!empty($pconfig['act']) && $pconfig['act'] == 'del') { } elseif (!empty($pconfig['act']) && $pconfig['act'] == 'del') {
if (isset($pconfig['id']) && !empty($a_hosts[$pconfig['id']])) { if (isset($pconfig['id']) && !empty($a_hosts[$pconfig['id']])) {
......
...@@ -150,7 +150,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -150,7 +150,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config('Modified Universal Plug and Play settings'); write_config('Modified Universal Plug and Play settings');
sync_package_miniupnpd(); sync_package_miniupnpd();
header("Location: services_upnp.php"); header(url_safe('Location: /services_upnp.php'));
exit; exit;
} }
} }
......
...@@ -88,7 +88,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -88,7 +88,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
usort($config['wol']['wolentry'], "wolcmp"); usort($config['wol']['wolentry'], "wolcmp");
write_config(); write_config();
header("Location: services_wol.php"); header(url_safe('Location: /services_wol.php'));
exit; 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