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