Looks like behavior of drupal_preg_match() was accidentally broken by cleanup a few months ago. Both argument offset and captured offset are not converted from characters to bytes and vice versa. Because of that we have infinite loops while Textimage is trying to wrap some Unicode strings.

Patch with the unit test follows.

Comments

dmitriy.trt’s picture

Status: Active » Needs review
StatusFileSize
new3.75 KB

Patch with the unit test for drupal_preg_match(). All 3 assertions from the test fails on current code.

mondrake’s picture

Well, thanks a lot for the patch, Dmitriy.trt.

It looks like I have been "overcleaning".... I wonder if this was also causing some of the issues reported in #1813592: Parse error with php 5.2.x.

mondrake’s picture

mondrake’s picture

Status: Needs review » Fixed

Committed and pushed to dev.

Status: Fixed » Closed (fixed)

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