[wp-trac] [WordPress Trac] #6877: preg_replace in wpautop deletes all the text in the post

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 30 10:04:29 GMT 2008


#6877: preg_replace in wpautop deletes all the text in the post
-----------------------------+----------------------------------------------
 Reporter:  duncanmc         |       Owner:  anonymous            
     Type:  defect           |      Status:  new                  
 Priority:  highest omg bbq  |   Milestone:  2.5.2                
Component:  Administration   |     Version:  2.5.1                
 Severity:  critical         |    Keywords:  preg_replace, wpautop
-----------------------------+----------------------------------------------
 I entered a preformatted HTML post, but the post was showing blank. I saw
 that it is because of the preg_replace in wpautop function in the file
 formatting.php. The problem code is

 {{{
 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); //
 make paragraphs, including one at the end
 }}}

 It is completely deleting the post content in some cases. There are also
 other users having the same problem in the forum. See
 http://wordpress.org/support/topic/156804?replies=6 for details. Could you
 please fix it?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6877>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list