resolv #1199, checkfqdn should allow subdomains of one char, such as a.foo.net

This commit is contained in:
mlutfy 2009-04-02 18:33:20 +00:00
parent 721a7b6e81
commit 9d9caa80da
1 changed files with 4 additions and 2 deletions

View File

@ -175,8 +175,10 @@ function checkfqdn($fqdn) {
while (list ($key, $val) = each ($members)) {
if (strlen($val)>63)
return 2;
if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) {
/*"*/ return 3;
// Note: a.foo.net is a valid domain
if (!eregi("^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",$val)) {
return 3;
}
}
return $ret;