fixing #26: not allowing underscore in domain names (except at the beginning of a domain member, like _tcp)

This commit is contained in:
Benjamin Sonntag 2016-01-13 17:26:47 +01:00
parent 6398702f74
commit 5f4b6ebb7b
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ function checkfqdn($fqdn) {
}
// Note: a.foo.net is a valid domain
// Note: RFC1035 tells us that a domain should not start by a digit, but every registrar allows such a domain to be created ... too bad.
if (!preg_match("#^[a-z0-9_]([a-z0-9-_]*[a-z0-9_])?$#i", $val)) {
if (!preg_match("#^[a-z0-9_]([a-z0-9-]*[a-z0-9])?$#i", $val)) {
return 3;
}
}