diff --git a/bureau/class/functions.php b/bureau/class/functions.php index 32fc1759..4f3d4a02 100644 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -177,7 +177,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; } } diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index f8e23e26..184dcc90 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -394,9 +394,9 @@ class m_dom { function create_default_subdomains($domain,$target_domain=""){ global $db,$err; $err->log("dom","create_default_subdomains",$domain); - $query="SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE concerned = 'SLAVE' or concerned = 'BOTH' and enabled=1;"; + $query="SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE (concerned = 'SLAVE' or concerned = 'BOTH') and enabled=1;"; if(empty($target_domain)) { - $query="SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE concerned = 'MAIN' or concerned = 'BOTH' and enabled=1;"; + $query="SELECT sub, domain_type, domain_type_parameter FROM default_subdomains WHERE (concerned = 'MAIN' or concerned = 'BOTH') and enabled=1;"; } $domaindir=$this->domdefaultdir($domain); $db->query($query);