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

Andrew Ozz admin at laptoptips.ca
Sun Jan 15 19:30:33 UTC 2012


On 14/01/2012 9:00 PM, Brandon Andrews wrote:
> ... a huge code dump at the end inside of a
> pre tag. I noticed that this breaks wordpress. This is 100% reproducible by
> pasting http://pastebin.com/6m3RVGbr into a post then hitting preview...

Seems to work properly on my test install (default PHP settings).

> I believe it's caused because there's over 64 KB of data in the pre tags.
> Talking to someone in the IRC and they said:
> "looks like there's a preg_replace_callback called clean_pre, probably that's
> what's failing due to size
>   basically, probably wpautop()'s fault"

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.


More information about the wp-hackers mailing list