Allow the root zone . to be excluded from top lists

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2022-09-20 16:16:40 +02:00
parent 344587c15b
commit e944c9d6c7

View File

@@ -45,6 +45,10 @@ function validDomain($domain_name, &$message = null)
function validDomainWildcard($domain_name)
{
// Skip this checks for the root zone `.`
if ($domain_name == '.') {
return true;
}
// There has to be either no or at most one "*" at the beginning of a line
$validChars = preg_match('/^((\\*\\.)?[_a-z\\d](-*[_a-z\\d])*)(\\.([_a-z\\d](-*[a-z\\d])*))*(\\.([_a-z\\d])*)*$/i', $domain_name);
$lengthCheck = preg_match('/^.{1,253}$/', $domain_name);