add extra validation for new domains

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-11-11 14:31:45 +01:00
parent 1f74bf059c
commit ace1651ceb
4 changed files with 5 additions and 1 deletions

View File

@@ -349,6 +349,8 @@ class Domains extends ApiCommand implements ResourceEntity
if (substr($p_domain, 0, 4) == 'xn--') {
Response::standardError('domain_nopunycode', '', true);
} elseif (Validate::validate_ip2($p_domain, true, '', true, true)) {
Response::standardError('domain_noipaddress', '', true);
}
$idna_convert = new IdnaWrapper();

View File

@@ -224,7 +224,7 @@ class Validate
* Check if the submitted string is a valid domainname
*
* @param string $domainname The domainname which should be checked.
* @param bool $allow_underscore optional if true, allowes the underscore character in a domain label (DKIM etc.)
* @param bool $allow_underscore optional if true, allows the underscore character in a domain label (DKIM etc.)
*
* @return string|boolean the domain-name if the domain is valid, false otherwise
*/