Page MenuHomePhabricator

SpamBlacklist doesn't work on PHP 5.2 ($regexMax too large?)
Closed, ResolvedPublic


Author: anaconda

I'm having troubles using the SpamBlacklist extension with PHP 5.2; the error log shows "[error] PHP Warning: preg_match() [<a href='function.preg-
match'>function.preg-match</a>]: Compilation failed: repeated subpattern is too long at offset 15711 in [blabla]/SpamBlacklist_body.php on line 210". I'm
not a PHP programmer, but with The Power of Google[tm], it seems caused by a change in the PCRE of PHP. Lowering $regexMax from 20000 to 15694 solves
the problem (15695 doesn't work).

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:32 PM
bzimport added a project: SpamBlacklist.
bzimport set Reference to bz8375.
bzimport added a subscriber: Unknown Object (MLST).

anaconda wrote:

Fixes $regexMax (just 1 line...)


In r19197 I've reduced the size to 4096. The actual PCRE internal limit seems to
be hard to predict; I think it's a limit on _compiled_ size rather than _input_
size, so input with fancy matching may complicate things.

Hopefully this'll do until we rework the whole rotten thing. :)