summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_dns.php
diff options
context:
space:
mode:
authorbcyrill <cyrill@bannwart.info>2012-04-11 23:12:34 +0300
committerbcyrill <cyrill@bannwart.info>2012-04-11 23:12:34 +0300
commit72cd706b8dc5032122e171a3abce7529917e1ce6 (patch)
treef05c84d3f71919e00985c347799fc8336a36c571 /usr/local/www/diag_dns.php
parentbf7f1e5ff84df33d18b5793849893045a73f9f1d (diff)
downloadpfsense-72cd706b8dc5032122e171a3abce7529917e1ce6.zip
pfsense-72cd706b8dc5032122e171a3abce7529917e1ce6.tar.gz
Remove [] of literal IPv6 addresses
Diffstat (limited to 'usr/local/www/diag_dns.php')
-rw-r--r--usr/local/www/diag_dns.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php
index 63c119a..0596373 100644
--- a/usr/local/www/diag_dns.php
+++ b/usr/local/www/diag_dns.php
@@ -93,14 +93,13 @@ if ($_POST) {
$reqdfieldsn = explode(",", "Host");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
- $host = trim($_POST['host']);
- $host_esc = escapeshellarg(trim($_POST['host']));
+ $host = trim($_POST['host'], " \t\n\r\0\x0B[]");
+ $host_esc = escapeshellarg($host);
- if (!is_hostname($host) && !is_ipaddr($host))
+ if (!is_hostname($host) && !is_ipaddr($host)) {
$input_errors[] = gettext("Host must be a valid hostname or IP address.");
-
- // Test resolution speed of each DNS server.
- if ((is_hostname($host) || is_ipaddr($host))) {
+ } else {
+ // Test resolution speed of each DNS server.
$dns_speeds = array();
$resolvconf_servers = `grep nameserver /etc/resolv.conf | cut -f2 -d' '`;
$dns_servers = explode("\n", trim($resolvconf_servers));
OpenPOWER on IntegriCloud