dhcp: url_safe() redirects for #1168

This commit is contained in:
Franco Fichtner 2016-10-10 08:56:16 +02:00
parent c78c9ced21
commit 57fb95f8a9
6 changed files with 14 additions and 14 deletions

View File

@ -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;
}
}

View File

@ -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">

View File

@ -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;
}
}

View File

@ -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']])) {

View File

@ -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;
}
}

View File

@ -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;
}
}