Make WordPress Core

Opened 19 years ago

Closed 17 years ago

#1685 closed defect (bug) (invalid)

the_content_rss() incorrectly applying filters to the_content

Reported by: kafkaesqui's profile Kafkaesqui Owned by: rob1n's profile rob1n
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: General Keywords:
Focuses: Cc:


the_content_rss() function is not applying filters to the_content_rss, but rather to the_content. This is (of course) causing issues with default filters and plugins acting upon the_content_rss.

Line 21 in feed-functions.php should be:

$content = apply_filters('the_content_rss', $content);

Attachments (1)

1685.diff (356 bytes) - added by rob1n 17 years ago.

Download all attachments as: .zip

Change History (10)

#1 @ryan
19 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3140]) Filter on the_content_rss. Props Kafkaesqui. fixes #1685

#2 @digory
18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 1.6 to 2.0.1

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.

#3 @digory
18 years ago

  • Cc jlavin@… added
  • Version changed from 2.0.1 to 2.0.2

In 2.0.2, it is line 25 that should be the same, with a line added above, as in the code above. Without the filters from the_content, an XML feed I created does not encode entities.

#4 @davidhouse
18 years ago

Entities come out fine without the patch for me, but perhaps we should include both filters for consistency with the_title_rss()

#5 @rob1n
17 years ago

  • Owner changed from anonymous to rob1n
  • Status changed from reopened to new

#6 @rob1n
17 years ago

  • Milestone set to 2.2
  • Status changed from new to assigned
  • Version changed from 2.0.2 to 2.1

17 years ago

#7 @rob1n
17 years ago

  • Keywords has-patch commit added; the_content_rss filters removed

#8 @ryan
17 years ago

We apply the_content_rss at the beginning of the function.

#9 @rob1n
17 years ago

  • Cc jlavin@… removed
  • Keywords has-patch commit removed
  • Milestone 2.2 deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

Sorry, must have missed it.

Note: See TracTickets for help on using tickets.