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

WordPress Trac wp-trac at lists.automattic.com
Tue May 6 06:46:18 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                     |   Resolution:           
 Keywords:  reporter-feedback , wpautop  |  
-----------------------------------------+----------------------------------
Comment (by ryan):

 Backtrack limit strikes again.  We might be able to preg_split on
 "\n\s*\n", strip newlines and add paragraph tags to each result, and
 concatenate it all back together again.  Failing that, we can check for an
 error from preg_last_error and rollback that preg_replace.
 preg_last_error() is PHP >= 5.2 so a function_exists check would be
 needed.  Trying a preg_split first is worth a shot, though.

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


More information about the wp-trac mailing list