Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#13047 closed defect (bug) (fixed)

Incorrect permalink redirection for feeds if default_feed is not RSS2

Reported by: solarissmoke Owned by:
Milestone: 3.0 Priority: low
Severity: minor Version: 3.0
Component: Feeds Keywords: has-patch
Focuses: Cc:


When pretty permalinks are enabled, and a client requests /?feed=rss2 (or /?feed=comments-rss2 etc), they are redirected to /feed/.

This is fine if the default_feed option is RSS2.

However, if it isn't (let's say it's set to Atom), then this behaviour is incorrect. Wordpress should redirect to /feed/rss/ (or /comments/feed/rss/) and rather than automatically redirecting to the default (now Atom) feed, because the client may be specifically requesting an RSS feed in preference to the default feed.

Proposed patch to follow once I can get my head round how permalink rewriting works..

Attachments (1)

13047.patch (1.3 KB) - added by solarissmoke 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @solarissmoke
8 years ago

  • Keywords dev-feedback has-patch added
  • Severity changed from normal to minor

There we go, this works for me. I also changed wp-feed.php to redirect to the default feed rather than assume it is rss2 (although being deprecated I don't know if it matters much).

#2 @nacin
8 years ago

  • Keywords dev-feedback removed

I was just about to post that it was canonical.php line 193 when I saw the patch.

Patch looks good. Technically the change to wp-feed.php is correct, though I'm not sure if it's worth to alter its functionality. Might as well, it'll be rss2 in most cases anyway.

8 years ago

#3 @solarissmoke
8 years ago

Just changed the doc to say "default" rather than "RSS2".

#4 @dd32
8 years ago

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

(In [14162]) Canonical redirect to correct location if rss2 is not default feed. wp-feed.php redirection to default feed type instad of rss2. Props solarissmoke. Fixes #13047

Note: See TracTickets for help on using tickets.