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.
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?
I'll look at it later this evening.
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.
Please remove the
Pull Request WIP tag.