Commit 57fb95f8 authored by Franco Fichtner's avatar Franco Fichtner

dhcp: url_safe() redirects for #1168

parent c78c9ced
...@@ -507,13 +507,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -507,13 +507,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
filter_configure(); filter_configure();
} }
reconfigure_dhcpd(); reconfigure_dhcpd();
header("Location: services_dhcp.php?if={$if}"); header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
exit; exit;
} }
} elseif (isset($_POST['apply'])) { } elseif (isset($_POST['apply'])) {
// apply changes // apply changes
reconfigure_dhcpd(); reconfigure_dhcpd();
header("Location: services_dhcp.php?if={$if}"); header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
exit; exit;
} elseif ($act == "del") { } elseif ($act == "del") {
if (!empty($config['dhcpd'][$if]['staticmap'][$_POST['id']])) { if (!empty($config['dhcpd'][$if]['staticmap'][$_POST['id']])) {
...@@ -528,14 +528,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -528,14 +528,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
} }
header("Location: services_dhcp.php?if={$if}"); header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
exit; exit;
} elseif ($act == "delpool") { } elseif ($act == "delpool") {
if (!empty($a_pools[$_POST['id']])) { if (!empty($a_pools[$_POST['id']])) {
unset($a_pools[$_POST['id']]); unset($a_pools[$_POST['id']]);
write_config(); write_config();
} }
header("Location: services_dhcp.php?if={$if}"); header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
exit; exit;
} }
} }
......
...@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($_GET['if']) && !empty($config['interfaces'][$_GET['if']])) { if (!empty($_GET['if']) && !empty($config['interfaces'][$_GET['if']])) {
$if = $_GET['if']; $if = $_GET['if'];
} else { } else {
header("Location: services_dhcp.php"); header(url_safe('Location: /services_dhcp.php'));
exit; exit;
} }
if (isset($if) && isset($_GET['id']) && !empty($config['dhcpd'][$if]['staticmap'][$_GET['id']])) { if (isset($if) && isset($_GET['id']) && !empty($config['dhcpd'][$if]['staticmap'][$_GET['id']])) {
...@@ -294,16 +294,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -294,16 +294,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
} }
header("Location: services_dhcp.php?if={$if}"); header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
exit; exit;
} }
} }
$service_hook = 'dhcpd'; $service_hook = 'dhcpd';
legacy_html_escape_form_data($pconfig); legacy_html_escape_form_data($pconfig);
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -73,7 +73,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -73,7 +73,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
// reconfigure // reconfigure
services_dhcrelay_configure(); services_dhcrelay_configure();
header("Location: services_dhcp_relay.php"); header(url_safe('Location: /services_dhcp_relay.php'));
exit; exit;
} }
} }
......
...@@ -317,12 +317,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -317,12 +317,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
filter_configure(); filter_configure();
} }
header("Location: services_dhcpv6.php?if={$if}"); header(url_safe('Location: /services_dhcpv6.php?if=%s', array($if)));
exit; exit;
} }
} elseif (isset($pconfig['apply'])) { } elseif (isset($pconfig['apply'])) {
reconfigure_dhcpd(); reconfigure_dhcpd();
header("Location: services_dhcpv6.php?if={$if}"); header(url_safe('Location: /services_dhcpv6.php?if=%s', array($if)));
exit; exit;
} elseif ($act == "del") { } elseif ($act == "del") {
if (!empty($config['dhcpdv6'][$if]['staticmap'][$_POST['id']])) { if (!empty($config['dhcpdv6'][$if]['staticmap'][$_POST['id']])) {
......
...@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($_GET['if']) && !empty($config['interfaces'][$_GET['if']])) { if (!empty($_GET['if']) && !empty($config['interfaces'][$_GET['if']])) {
$if = $_GET['if']; $if = $_GET['if'];
} else { } else {
header("Location: services_dhcpv6.php"); header(url_safe('Location: /services_dhcpv6.php'));
exit; exit;
} }
if (isset($if) && isset($_GET['id']) && !empty($config['dhcpdv6'][$if]['staticmap'][$_GET['id']])) { if (isset($if) && isset($_GET['id']) && !empty($config['dhcpdv6'][$if]['staticmap'][$_GET['id']])) {
...@@ -145,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -145,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
header("Location: services_dhcpv6.php?if={$if}"); header(url_safe('Location: /services_dhcpv6.php?if=%s', array($if)));
exit; exit;
} }
} }
......
...@@ -74,7 +74,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -74,7 +74,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
// reconfigure // reconfigure
services_dhcrelay6_configure(); services_dhcrelay6_configure();
header("Location: services_dhcpv6_relay.php"); header(url_safe('Location: /services_dhcpv6_relay.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