@robocoder opened this Pull Request on March 31st 2018 Contributor

Clean port of LGPL libidn2 punycode decoder.

Intended to be a starting point for #11640 (URL's with IDN shows in Punycode).

Unlike the punycode decoder in libs/Zend/Validate/Hostname.php, this decoder:

  • has a public method
  • decodes some punycode that Zend_Validate_Hostname doesn't, e.g., xn--e1afmkfd.xn--p1ai (see INTL_IDNA_VARIANT_UTS46)

Might eventually allow removal of libs/Zend/Validate (if someone writes an email address validator). The code point validator in Zend_Validate_Hostname is dubious given the preg_match buffer limit.

@mattab commented on April 24th 2018 Owner

Hi @robocoder Thanks for the PR. Is there by any chance an existing PHP package we could reuse for this logic? Maybe in the symfony codebase or so?

@robocoder commented on April 24th 2018 Contributor

Sorry, I don't have the interest/time to integrate 3rd party libs. If anyone is interested, look at https://github.com/arubacao/tld-checker (for the TLD list) and https://github.com/true/php-punycode (to encode/decode PunyCode). I recommend adding a wrapper to use the intl extension functions if available.

This Pull Request was closed on April 24th 2018
Powered by GitHub Issue Mirror