[wp-trac] [WordPress Trac] #28937: Post content randomly disappears in editor after save

WordPress Trac noreply at wordpress.org
Fri Jul 18 13:49:24 UTC 2014


#28937: Post content randomly disappears in editor after save
-------------------------------+------------------------------
 Reporter:  chaoix             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Editor             |     Version:  3.9.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by chaoix):

 For wpauto_p, the issue appears to be related to character set encoding.
 Adding a 'u' flag to the regex in this line fixed the function:
 {{{
 #!php
 //Added u flag to the regex in the next line
 $pee = preg_replace('|(?<!<br />)\s*\n|u', "<br />\n", $pee); //
 optionally make line breaks
 }}}
 The bigger problem in the wpauto_p function is it uses a ton of
 preg_replace calls and doesn't check for a NULL return from any of them so
 if any of the regex errors out, all of the content comes back as NULL.

 This maybe related to running it under IIS, although I am not positive.
 The easiest way to break the TinyMCE was to add extra line breaks in
 between text and images. We are using Otto's TinyMCE advanced plugin to
 preserve the whitespace in our HTML, which made this issue easier to
 reproduce.

 My fix for TinyMCE was to edit out the 'richedit_pre' and 'htmledit_pre'
 filters because the content wasn't coming back from them. There is
 definitely a better solution, but this was my workaround.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28937#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list