Merge pull request #2960 from mailcow/revert-2941-domain-name-fix

Revert "Make is_valid_domain_name more strict"
master
André Peters 2019-09-21 14:17:08 +02:00 committed by GitHub
commit 3ed7690115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -714,9 +714,9 @@ function is_valid_domain_name($domain_name) {
return false; return false;
} }
$domain_name = idn_to_ascii($domain_name, 0, INTL_IDNA_VARIANT_UTS46); $domain_name = idn_to_ascii($domain_name, 0, INTL_IDNA_VARIANT_UTS46);
return (preg_match("/^([a-z\d](-*[a-z\d])*)\.(([a-z\d](-*[a-z\d])*))*$/i", $domain_name) return (preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain_name)
&& preg_match("/^.{1,253}$/", $domain_name) && preg_match("/^.{1,253}$/", $domain_name)
&& preg_match("/^[^\.]{1,63}\.([^\.]{1,63})*$/", $domain_name)); && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name));
} }
function set_tfa($_data) { function set_tfa($_data) {
global $lang; global $lang;