[wp-trac] Re: [WordPress Trac] #6099: WordPress Filters Not Properly Converting Newline Characters When Submitting Via AJAX

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 6 02:10:18 GMT 2008


#6099: WordPress Filters Not Properly Converting Newline Characters When
Submitting Via AJAX
---------------------+------------------------------------------------------
 Reporter:  ronalfy  |        Owner:  anonymous
     Type:  defect   |       Status:  reopened 
 Priority:  normal   |    Milestone:           
Component:  General  |      Version:  2.5      
 Severity:  major    |   Resolution:           
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by ronalfy):

 Upon even further investigation,  the '''comment_text''' filter calls the
 '''convert_smilies''' function.  It looks like the newlines are being
 stripped out on line 687 in formatting.php
 {{{
 $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
 }}}

 This is what goes into the '''convert_smilies''' function:

 {{{
 "First Paragraph :)\nd\nSecond Paragraph :)\n\nThird Paragraph\n"
 }}}

 This is what comes out before hitting the '''wpautop''' function (the next
 function to be called by the '''comment_text''' filter:

 {{{
 "First Paragraph <img src='http://127.0.0.1/raproject/wp-
 includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
 d\nSecond Paragraph <img src='http://127.0.0.1/raproject/wp-
 includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
 \nThird Paragraph\n"
 }}}

 Notice that the newline character before the "d" is stripped out, and a
 newline before "Third Paragraph" is stripped out.

 If smilies are disabled for WordPress in the Writing panel, this bug
 disappears.

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


More information about the wp-trac mailing list