Open xiaohuilam opened 1 year ago
Thank you very much for notifying. Let's increase it to 255. What do you think?
I'm on it.
Thank you very much for notifying. Let's increase it to 255. What do you think?
Perhaps okay, but why there's a limitation for hostname length?
Hello
This domain is valide xn--c1aafynu.xn--c1avg.xn--p1acf, but the regex doesn't match because the xn part is not in the TDL -> ^(([\w\d_-]+){1,63}.)+([\w\d_-]+){2,63}$
Why the lib, don't use https://www.php.net/manual/en/filter.filters.validate.php
@xiaohuilam can you test https://github.com/bluelibraries/dns/pull/3 ?
@xiaohuilam can you test #3 ?
@james2001 I think this is better.
filter_var($hostName, FILTER_VALIDATE_DOMAIN)
because it will return false if $hostName = '_dnsauth.test.com'
in your code:
$hostName = '_dnsauth.test.com';
var_dump(filter_var($hostName, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)); // it returns `false`, and unexpected.
_dnsauth
is digicert's domain validation hostname prefix, it's allowed to be created as dns host for mostly dns service providers.
and, please mention @bluelibraries for more review because he is the owner of this repository.
@xiaohuilam I fix it, but un didn't understand. _dnsauth.test.com is not a valide hostname (RFC 1034 et 1035). Perhaps rename the method, to be more explicite
https://github.com/bluelibraries/dns/blob/92208ec7fdeba26e0a1795904bc452fe92624e3a/src/Handlers/AbstractDnsHandler.php#L98-L103