Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Piwik\Intl\Idn and TLD domain provider #12689

Closed
wants to merge 1 commit into from

Conversation

robocoder
Copy link
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.

@sgiehl sgiehl added the Needs Review PRs that need a code review label Apr 1, 2018
@mattab
Copy link
Member

mattab commented Apr 24, 2018

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?

@mattab mattab added this to the 3.6.0 milestone Apr 24, 2018
@robocoder
Copy link
Contributor Author

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.

@robocoder robocoder closed this Apr 24, 2018
@robocoder robocoder deleted the intl-idn-patch branch March 26, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants