Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#14451 closed defect (bug) (fixed)

RSS2 feed generates invalid category markup when 'default_feed' is 'atom'

Reported by: benward's profile benward Owned by: benward's profile benward
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0
Component: Feeds Keywords: has-patch
Focuses: Cc:


If you override the 'default_feed' filter to return 'atom' (to make Atom format feeds the WordPress default at /feed/), the RSS2 format is broken because it does not explicitly declare 'rss2' as its category format, instead implying the default from get_default_feed() in get_the_category_rss(). When 'default_feed' is set to 'atom', Atom formatted categories are returned in RSS.

Attached is a one line patch for feed-rss2.php, which explicitly declares the format when including categories.

(Credit for this catch to my colleague Michael Lodick at Yahoo, whose feed importer I broke with the format religiosity that exposed this bug.)

Attachments (1)

bugfix-rss2-category-format.diff (636 bytes) - added by benward 13 years ago.
One line patch to make 'the_category_rss' explicitly declare 'rss2' as format

Download all attachments as: .zip

Change History (4)

13 years ago

One line patch to make 'the_category_rss' explicitly declare 'rss2' as format

#1 @nacin
13 years ago

  • Keywords has-patch added; feeds rss2 default_feed atom removed
  • Milestone changed from Awaiting Review to 3.1

Is this an issue for other types of data, and other feed types? Or just categories in the RSS2 feed.

#2 @mlodick
13 years ago

It looks like it's only the_category_rss() that gets called without arguments and depends on 'rss2' being the default type.

#3 @nacin
13 years ago

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

(In [15984]) Specify feed type in the_category_rss() call. props benward, fixes #14451.

Note: See TracTickets for help on using tickets.