Project

General

Profile

« Previous | Next » 

Revision 2cc24f95

Added by Jim Pingle over 6 years ago

Allow a trailing dot in a hostname on diag_dns.php. Fixes #9276

(cherry picked from commit e56c473d7c4c2e7de71c43420c844e452dbcfa82)

View differences:

src/usr/local/www/diag_dns.php
133 133

  
134 134
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
135 135

  
136
	if (!is_hostname($host) && !is_ipaddr($host)) {
136
	if (!is_hostname(rtrim($host, '.')) && !is_ipaddr($checkhost)) {
137 137
		$input_errors[] = gettext("Host must be a valid hostname or IP address.");
138 138
	} else {
139 139
		// Test resolution speed of each DNS server.
......
167 167
				$tmpresolved['data'] = $resolvedptr;
168 168
				$resolved[] = $tmpresolved;
169 169
			}
170
		} elseif (is_hostname($host)) {
170
		} elseif (is_hostname(rtrim($host, '.'))) {
171 171
			$type = "hostname";
172 172
			$ipaddr = gethostbyname($host);
173 173
			$resolved = resolve_host_addresses($host);

Also available in: Unified diff