WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 7 years ago

#10509 closed defect (bug) (duplicate)

feed-rss2.php tests for $post->post_content without applying the_content filters

Reported by: nateomedia Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Feeds Keywords: has-patch
Focuses: Cc:
PR Number:

Description

feed-rss2.php contains an if statement that tests to see if $post->post_content is greater than zero before using the_content (which may be changed to the_content_rss) to populate the <content: encoded> tag.

feed-rss2..php, line 48:

<?php if ( strlen( $post->post_content ) > 0 ) : ?>

No other RSS feed does this.

The problem is that this test does not take into account the_content filters, which may populate an otherwise empty post. The ComicPress theme is a real world instance where this occurs -- posts containing comics are populated using apply_filters to the_content rather than through direct entry when a new post is created.

If the RSS 2 feed template is to behave differently than the other feeds, it should at least apply the_content filters before testing for content rather than pulling directly from $post->post_content.

Otherwise, the RSS 2 feed template should be brought in line with the other feed templates and this test should be removed.

Attachments (2)

10509.patch (747 bytes) - added by peaceablewhale 10 years ago.
10509-v2.patch (4.5 KB) - added by peaceablewhale 10 years ago.

Download all attachments as: .zip

Change History (9)

#1 @peaceablewhale
10 years ago

  • Keywords has-patch added; rss 2 rss feed the_content post_content removed
  • Milestone changed from Unassigned to 2.9

I have uploaded a patch that removes the condition check.

#2 @dd32
10 years ago

i dont think removing the the_excerpt_rss() case is the right way to go about it

#3 @peaceablewhale
10 years ago

<content:encoded> should not contain summary. The <description> element does that.

#4 @peaceablewhale
10 years ago

The second version of the patch will check if get_the_content is empty.

#5 @ryan
10 years ago

  • Milestone changed from 2.9 to Future Release

#6 @nateomedia
9 years ago

A year has passed and this ticket hasn't been closed. Is there any chance of this being scheduled from release? I know there are bigger issues to deal with and everything, but every update I have to go and manually patch feed-rss2.php — it would be nice to see this fixed. Thank you.

#7 @SergeyBiryukov
7 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.