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

Update list of valid TLDs and IDNs #12555

Closed
wants to merge 4 commits into from

Conversation

robocoder
Copy link
Contributor

  • Backport changes from:
    • Zend_Validate_Hostname from ZF 1.12.20
    • Zend\Validator\Hostname ZF2 (b3ebdf2, Feb 1, 2018)

@robocoder
Copy link
Contributor Author

Maybe it would be better to replace Zend_Validate_Hostname with a custom validator and library, eg Piwik\Intl\DomainName? It could ship with a list of TLDs and IDNs but also have a way to download/use an out-of-band update.

@mattab mattab added this to the 3.3.1 milestone Mar 19, 2018
@mattab
Copy link
Member

mattab commented Mar 19, 2018

Hi @robocoder
Thanks for the PR 👍 Noticed that the integration test which checks against many TLDs is now failing in: https://travis-ci.org/matomo-org/matomo/jobs/340708272

1) Piwik\Tests\Integration\EmailValidatorTest::test_allCurrentTlds
preg_match(): Compilation failed: regular expression is too large at offset 156184
/home/travis/build/matomo-org/matomo/libs/Zend/Validate/Hostname.php:2358
/home/travis/build/matomo-org/matomo/libs/Zend/Validate/EmailAddress.php:487
/home/travis/build/matomo-org/matomo/libs/Zend/Validate/EmailAddress.php:546
/home/travis/build/matomo-org/matomo/core/Piwik.php:575
/home/travis/build/matomo-org/matomo/tests/PHPUnit/Integration/EmailValidatorTest.php:21
/home/travis/build/matomo-org/matomo/tests/PHPUnit/Integration/EmailValidatorTest.php:66

Would you be able to update this integration test so it passes again?

@mattab mattab modified the milestones: 3.3.1, 3.4.0 Mar 19, 2018
@mattab mattab added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. Needs Review PRs that need a code review labels Mar 19, 2018
@robocoder
Copy link
Contributor Author

I'll look at it later this evening.

@robocoder
Copy link
Contributor Author

The regex pattern buffer max length is determined by a compile-time setting when building php. Since this can vary between platforms, I arbitrarily used a cutoff of 256.

@robocoder
Copy link
Contributor Author

Please remove the Pull Request WIP tag.

@Findus23 Findus23 removed the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Apr 17, 2018
@robocoder robocoder closed this Apr 24, 2018
@robocoder robocoder deleted the 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