I’m getting this error with TruncHTML:
Warning: Wrong value for parameter 4 in call to preg_match_all() in /public_html/ee/plugins/pi.trunchtml.php on line 63
Using PHP 4.3.2.
I’ve contacted the developer but he hasn’t come back with anything…
Anyone seen this before?
I have no PHP version older than 4.3.2.2 where it works. There is a bug report on PHP.net for 4.3.2 about this funtion, though.
Try this:
Open pi.trunchtml.php in a text editor. Find PREG_OFFSET_CAPTURE in line 63. Replace it with PREG_OFFSET_CAPTURE|PREG_PATTERN_ORDER.
The line should then read:
if (preg_match_all('/&[0-9a-z]{2,8};|[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE|PREG_PATTERN_ORDER)) {
Great! That seemed to solve it.
Is PREG_OFFSET_CAPTURE something new to the latest versions of PHP?
At any rate, it’s working well. Great plugin. Thanks for writing it.
You should really give people a way to make donations on your website. I’d give a few dollars.
If you get that set up, shoot me a note.
That flag was introduced in 4.3.0. That was in Dec. 2002 by the way, so not exactly recent 😉
Usually, and according to the manual, you don’t have to specify PREG_PATTERN_ORDER as it is the deafult sort order. Turns out there were one or two builds where you have to nonetheless, otherwise you get that warning.
You got one of those, me thinks.
I will add that to the next version. It’s superfluous but it doesn’t hurt.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.