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
PCRE regex validation problem for pcre8 mode #425
Comments
Can you post an example of an address that triggers this? There is a fix in PCRE 8.37 for a bug in 8.36 that generates this error, so it may be that. |
In my case it was for all e-mail addresses of our new users. Something like |
For me it was typical email address: test@test1.com |
I'm having no trouble with these addresses with PCRE 8.36 in PHP 5.6.9 and the 'pcre8' pattern, so it seems there must be an environmental factor involved. It sounds like it might be similar to the problems that arose before PCRE 8.03. It's tempting to dump those custom patterns altogether and just use the PHP filter_var one since it's almost identical. FWIW, the test suite on Travis-CI runs all the same validation checks using PHP 5.3, 5.4, 5.5, 5.6 and 7 and none have been failing there. |
For me the validation is not important at all, so I would prefer to have a component which always works without any version-specific functions. Especially when it comes to mail function which popular across the community. |
I've just given this a try. Reverting to the class myMailer extends PHPMailer {
public static function validateAddress($address, $patternselect = 'php')
{
return parent::validateAddress($address, $patternselect);
}
} Subclassing is a good habit anyway as it provides isolation between a specific implementation and your app code - I do this nearly everywhere I use PHPMailer. If you want to take this further, you could report this to the author of the |
It appears that this is a PHP bug affecting PHP version 5.5.25 and 5.6.9 when run as an apache handler (i.e. mod_php), see #429, which is actually a duplicate of this issue. |
On my production environment PHPMailer suddenly stopped sending the messages.
The error in PHPMailer:
preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 728
which comes from validateAddress function after case 'pcre8'.
After the research I found that it can be related to PCRE library update. The environment is Debian+Apache+PHP5+PCRE 8.36.
There was no solution for me, so I force $patternselect = 'pcre'; and now it is working.
It would be great to take a look why pcre8 regex is not compatible with the recent version of PCRE.
Thanks!
The text was updated successfully, but these errors were encountered: