Opened 21 years ago
Closed 19 years ago
#1685 closed defect (bug) (invalid)
the_content_rss() incorrectly applying filters to the_content
| Reported by: | Kafkaesqui | Owned by: | rob1n |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
20 years ago
- Resolution fixed
- Status closed → reopened
- Version 1.6 → 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
@
20 years ago
- Cc added
- Version 2.0.1 → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [3140]) Filter on the_content_rss. Props Kafkaesqui. fixes #1685