Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Bug with lookback assersions on specific PCRE version
#1
Looks like some of our users running a version PCRE are having an error show up with completely valid regex

Quote:Warning [2] preg_replace() [function.preg-replace]: Compilation failed: lookbehind assertion is not fixed length at offset 8 - Line: 406 - File: inc/class_parser.php PHP 5.2.5 (Linux)

We need to look into which versions of PCRE this affects and try and develop a method to workaround it, if possible.
#2
After reading this PHP bug report and the information about Positive / negative lookahead / lookbehind, I can assume that the bug occur because PCRE doesn't support negated character class.

But in this PHP bug report and regex tester pag it's seems that the problem occur only when the negated character class contain only one char but not when the character class contain more chars... WEIRD

Anyway, since a negated character class inside a lookaround is problematic, I'm suggest to make it a normal character class, if feasible.

When searching for a bug report in the PCRE bug list, I can find only one result that is actually a feature request and not a bug. So we can report this bug (regitration requirement).

BTW,
Here you can get a quick reference of the source:
http://crossreference.mybboard.de/nav.ht....html#l406
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
#3
It is definately a bug in PCRE because it works fine on like 99% of installations. It's only those few installations which run a certain version of PCRE that it screws up on.

I've already got an experimental workaround for this and I'm just waiting on a member to test it
#4
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
#5
Can some people try this fix to make sure there isn't any regressions?

http://community.mybboard.net/thread-414...#pid280357

Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)