WordPress short tag attributes not parsing?

I recently had an issue with wordpress 3.9.1 short tags not parsing correctly. It would call the appropriate function but not populate any of the appropriate attributes. Infuriatningly the issue was only on my live server and not on my development machine so it was a lot of trial and error to track it down. After investigating the problem in the third party plugin for a while I eventually tracked the problem down to the following regular expressions returning NULL.

$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);

Checking the php logs had the following error:

Warning: preg_replace() [function.preg-replace]: Compilation failed: unknown option bit(s) set at offset -1 in /path/to/public_html/wp-includes/shortcodes.php on line 257

The problem was an I was running version 7.8 of PCRE (Perl-compatible regular expression) libraries. A quick update to 8.21 solved the problem straight away.

yum update pcre

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>