[wp-hackers] Too much text in pre tag causes failure to generate page

Alexander Concha alex at buayacorp.com
Sun Jan 15 20:24:58 UTC 2012

On Sun, Jan 15, 2012 at 8:30 PM, Andrew Ozz <admin at laptoptips.ca> wrote:
> On 14/01/2012 9:00 PM, Brandon Andrews wrote:
>>  [...]
> Yes, seems that way. Can you try making the regex in that
> preg_replace_callback "greedy"? I.e. remove the question mark on line 211 in
> wp-content/formatting.php so it looks like this:
> $pee = preg_replace_callback('!(<pre[^>]*>)(.*)</pre>!is', 'clean_pre', $pee
> );
> Don't think the (.*) needs to be non-greedy there anyways.

It is required to be non-greedy. Otherwise, wpautop() would return
invalid html when there are two or more pre tags. For example
"<pre>foo</pre> bar <pre>baz</pre>".

Alexander Concha

More information about the wp-hackers mailing list