WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:

Description

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 5 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 @solarissmoke5 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).

comment:2 @nacin5 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.

@solarissmoke5 years ago

comment:3 @solarissmoke5 years ago

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

comment:4 @dd325 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.