Opened 19 years ago
Closed 18 years ago
#1685 closed defect (bug) (invalid)
the_content_rss() incorrectly applying filters to the_content
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
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)
Change History (10)
#2
@
19 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
@
19 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
@
19 years ago
Entities come out fine without the patch for me, but perhaps we should include both filters for consistency with the_title_rss()
(In [3140]) Filter on the_content_rss. Props Kafkaesqui. fixes #1685