@robocoder opened this Pull Request on February 12th 2018 Contributor
  • Backport changes from:
    • Zend_Validate_Hostname from ZF 1.12.20
    • Zend\Validator\Hostname ZF2 (b3ebdf2, Feb 1, 2018)
@robocoder commented on February 14th 2018 Contributor

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 commented on March 19th 2018 Member

Hi @robocoder
Thanks for the PR :+1: 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?

@robocoder commented on March 23rd 2018 Contributor

I'll look at it later this evening.

@robocoder commented on March 24th 2018 Contributor

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 commented on April 17th 2018 Contributor

Please remove the Pull Request WIP tag.

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