Getting this error whenever PHPMailer sends an email.

preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 8 in \mydrupal\sites\default\modules\messaging\messaging_phpmailer\messaging_phpmailer.module on line 81.

Server: PHP 5.1.5, IIS 6, Windows 2003

Tested on PHP 5.2.8, Apache 2.2.11, Windows XP, no error.
Tested on PHP 5.1.4, Apache 6.0.63, Windows XP, no error.

PCRE library versions match on both the production and test servers.

So, no explanation for this error at all.

I fixed it by rewriting the preg_match() call to avoid named subpatterns, and added a couple if statements to preserve the interface on the $from variable.

Comments

jose reyero’s picture

Status: Active » Postponed (maintainer needs more info)

I'd consider this fix if someone else can test it on *non Windows* machines, otherwise it may be a php on windows or charset related issue...

(I just wouldn't like to break it on *nix which is the one most peoples uses)

domesticat’s picture

I'm seeing this error on a non-Windows machine. I've applied the patch and will keep an eye on it for the next few days to see if the PHP errors stop.

domesticat’s picture

I haven't seen any errors in the past few days when using the patch on my Ubuntu box.

fred0’s picture

Just started testing PHPMailer and immediately got this message on a CentOS linux box. The patch seems to get rid if the error, but I can't vouch for it beyond that as I haven't tested enough.

jose reyero’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, committed (I've cleaned the variable names).

Thanks for the patch and for testing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.