Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#4550 closed defect (bug) (fixed)

Category RSS feed function broken with URL rewrites

Reported by: gwagenknecht Owned by: markjaquith
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords:
Focuses: Cc:


If you have URL rewrite enable the get_category_rss_link function in feed.php returns wrong feed URLs. It forgets to add a slash between the category link and the feed suffix. For example /category/mycategoryname becomes /category/mycategorynamefeed which is wrong.

The fix is quite simple. In feed.php change line 137 from:

$link = $link . user_trailingslashit('feed', 'feed');


$link = trailingslashit($link) . user_trailingslashit('feed', 'feed');

Attachments (1)

trailingslashit.diff (857 bytes) - added by markjaquith 8 years ago.
Patch for trunk

Download all attachments as: .zip

Change History (4)

#1 @westi
8 years ago

  • Milestone set to 2.3 (trunk)
  • Severity changed from major to normal

The fix isn't quite correct.

There are two of these issues in feed.php

In both cases a url should be built and then user_trailingslashit called.


$link = user_trailingslashit($link . '/feed', 'feed');

8 years ago

Patch for trunk

#2 @markjaquith
8 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

Westi, but in that case, people who DO have trailing slashes will get:


If we're adding something to the end of the URL, we must use trailingslashit() on the previous part. And then we use user_trailingslashit() on the last part. See patch.

#3 @markjaquith
8 years ago

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

(In [6100]) fix links generated by get_category_rss_link(). props gwagenknecht. fixes #4550 for trunk

Note: See TracTickets for help on using tickets.