Open harrybailey opened 8 years ago
Well, 4 years later... does anyone have a solution to this?
how good is anyones regex?
+[a-z]{2,6})|
in this line of code
$regex = "/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i";
Would that be the fix, changing the 6 to say? 20?
Try to replace it with filter_var. If it works, PRs are welcome :)
https://www.php.net/manual/en/filter.examples.validation.php
Big fat warning for anyone still making use of this or considering using it.
The email validation function _validateAddress has a specific length check for the final part tld of the domain. It's limited to 6 characters.
Enter such domains as .academy (7 characters) and watch the invalid email exceptions fly.