mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Allow dot at end of FQDN for a host
Redmine #4124 has discussion of this.
This commit is contained in:
parent
71ddc9ef4a
commit
8b3d14bc87
@ -686,8 +686,13 @@ function is_hostname($hostname) {
|
||||
if (!is_string($hostname))
|
||||
return false;
|
||||
|
||||
if (preg_match('/^(?:(?:[a-z0-9_]|[a-z0-9_][a-z0-9_\-]*[a-z0-9_])\.)*(?:[a-z0-9_]|[a-z0-9_][a-z0-9_\-]*[a-z0-9_])$/i', $hostname))
|
||||
return true;
|
||||
if (is_domain($hostname))
|
||||
if ((substr_count($hostname, ".") == 1) && ($hostname[strlen($hostname)-1] == ".")) {
|
||||
/* Only a single dot at the end like "test." - hosts cannot be directly in the root domain. */
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user