sahvx655-wq opened a new pull request, #409:
URL: https://github.com/apache/commons-validator/pull/409
DomainValidator keeps the IANA TLD lists as sorted arrays and decides a
TLD's category from which array holds it. While going over the IDN country-code
entries I noticed бг (punycode xn--90ae) sitting in GENERIC_TLDS, even though
its Cyrillic neighbours срб and бел are in COUNTRY_CODE_TLDS. бг is the ccTLD
delegated to Bulgaria for the two-letter code BG, so
isValidCountryCodeTld("xn--90ae") and isValidCountryCodeTld("бг") wrongly
return false while isValidGenericTld("xn--90ae") returns true.
Moving the entry into COUNTRY_CODE_TLDS, in its sorted position so the
binary-search lookup still holds, makes the per-category checks agree with the
IANA delegation. isValidTld and isValid already returned true through the
category OR, so only the category-specific methods change behaviour. Left as
is, callers that branch on TLD category (treating ccTLDs differently from
gTLDs) mishandle Bulgarian domains. Added the matching assertions to
DomainValidatorTest.testTopLevelDomains.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]