summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@netgate.com>2019-01-21 11:38:31 -0500
committerjim-p <jimp@netgate.com>2019-01-21 11:39:08 -0500
commit2cc24f953615902ad1d09be8cbf9aa4a2ddcb452 (patch)
treeb56aabf691a497c4f679aa785ae3880883fc3876
parentf6775a831f9ca6a9a4c0632ac3fe041c30e39922 (diff)
downloadpfsense-2cc24f953615902ad1d09be8cbf9aa4a2ddcb452.zip
pfsense-2cc24f953615902ad1d09be8cbf9aa4a2ddcb452.tar.gz
Allow a trailing dot in a hostname on diag_dns.php. Fixes #9276
(cherry picked from commit e56c473d7c4c2e7de71c43420c844e452dbcfa82)
-rw-r--r--src/usr/local/www/diag_dns.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php
index e190e44..443035e 100644
--- a/src/usr/local/www/diag_dns.php
+++ b/src/usr/local/www/diag_dns.php
@@ -133,7 +133,7 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- if (!is_hostname($host) && !is_ipaddr($host)) {
+ if (!is_hostname(rtrim($host, '.')) && !is_ipaddr($checkhost)) {
$input_errors[] = gettext("Host must be a valid hostname or IP address.");
} else {
// Test resolution speed of each DNS server.
@@ -167,7 +167,7 @@ if ($_POST) {
$tmpresolved['data'] = $resolvedptr;
$resolved[] = $tmpresolved;
}
- } elseif (is_hostname($host)) {
+ } elseif (is_hostname(rtrim($host, '.'))) {
$type = "hostname";
$ipaddr = gethostbyname($host);
$resolved = resolve_host_addresses($host);
OpenPOWER on IntegriCloud