Commit 011364e3 authored by fred's avatar fred

misc: allow domain names with a single character

parent b48c4bf4
......@@ -175,8 +175,15 @@ 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;
if (strlen($val) == 1) {
/* special case domain with a single character */
if (!eregi("^[a-z0-9]$",$val)) {
/*"*/ return 3;
}
} else {
if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) {
/*"*/ return 3;
}
}
}
return $ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment