[wp-trac] Re: [WordPress Trac] #1685: the_content_rss() incorrectly applying filters to the_content

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 15 20:11:45 GMT 2006


#1685: the_content_rss() incorrectly applying filters to the_content
-----------------------+----------------------------------------------------
       Id:  1685       |      Status:  reopened                
Component:  General    |    Modified:  Wed Feb 15 20:11:44 2006
 Severity:  normal     |   Milestone:                          
 Priority:  normal     |     Version:  2.0.1                   
    Owner:  anonymous  |    Reporter:  Kafkaesqui              
-----------------------+----------------------------------------------------
Changes (by digory):

  * resolution:  fixed =>
  * version:  1.6 => 2.0.1
  * status:  closed => reopened

Comment:

 This fix seems to have broken numerical entities. I think Line 21 should
 have been the same, and add a new line for Kafkaesqui's fix.

 A la:

 {{{
 $content = apply_filters('the_content', $content);
 $content = apply_filters('the_content_rss', $content);
 }}}

 I may be wrong, but it seems to me that apply_filters does not change the
 output of the_content(). Rather, apply_filters takes some filters used for
 the_content (namely, convert_smilies and convert_chars -- see default-
 filters.php) and applies them to $content for this function.

 Without both of the lines I included above, ampersands come out like '&'
 and curly quotes and en dashes are not encoded at all. This produces bad
 XML.

 Note how get_the_title_rss() does it. It uses apply_filters with both
 the_title and the_title_rss. Either it needs to look like
 the_content_rss() or vice versa.

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


More information about the wp-trac mailing list