Autorise le '_' dans les sous domaines
This commit is contained in:
Alan Garcia 2012-12-11 15:29:21 +00:00
parent a1edf99239
commit d7101646ba
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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);