Ticket #7044 (closed defect: fixed)

Opened 3 months ago

Last modified 2 months ago

get_tag_feed_link() doesn't add slash

Reported by: scribu Assigned to: mtekk
Priority: normal Milestone:
Component: General Version: 2.5.1
Severity: normal Keywords: feed, tag, permalinks
Cc:

Description

This error occurs when (almost) pretty permalinks are used and there is no trailing slash: get_tag_feed_link() doesn't add a slash before 'feed'.

Example:

Permalink struncture: /%category%/%postname%.html

Tag url: http://example.com/tag_base/tag

Tag feed: http://example.com/tag_base/tagfeed

Change History

05/27/08 12:24:03 changed by Viper007Bond

  • status changed from new to closed.
  • resolution set to worksforme.
  • milestone deleted.

Add a trailing slash to your permalink structure at Settings -> Permalinks. WordPress (including get_tag_feed_link()) generates URLs based on your preference set there.

05/27/08 12:25:20 changed by Viper007Bond

And if you wish to use a structure without a trailing slash (as you are with .html), you'll just need to add the slash manually when you want a trailing slash.

(follow-up: ↓ 5 ) 05/27/08 12:28:34 changed by DD32

I dont agree with that Viper007Bond.

You are correct that it uses that, And if you want a slash on the end of the url, then it needs to be set

However, In the permalink structure given, you do not want a trailing slash, and you do want a slash before any suffix's which are applied.

Ie. In this case, The missing slash is: Tag feed: http://example.com/tag_base/tag'''/'''feed

05/27/08 12:31:14 changed by scribu

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone set to 2.5.2.

I agree with DD32, and would like to mention that get_category_feed_link() works without a trailing slash in the permalink structure.

(in reply to: ↑ 3 ) 05/27/08 12:33:54 changed by Viper007Bond

Replying to DD32:

You are correct that it uses that, And if you want a slash on the end of the url, then it needs to be set However, In the permalink structure given, you do not want a trailing slash, and you do want a slash before any suffix's which are applied.

Oh, I'm sorry. I misread the ticket. I thought he was talking about the very end slash.

You're completely right. It should trailingslashit() rather than the "maybe" version.

My apologies.

05/27/08 12:43:27 changed by guillep2k

  • cc deleted.

Please don't add my name to Cc: without at least a word on what do you expect from me. Thanks.

05/27/08 17:56:46 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [8000]) Fix slashing in tag feed link. fixes #7044 for trunk

05/27/08 17:57:36 changed by ryan

(In [8001]) Fix slashing in tag feed link. fixes #7044 for 2.5

07/15/08 16:24:07 changed by ryan

  • milestone changed from 2.5.2 to 2.9.

Milestone 2.5.2 deleted

07/19/08 22:15:27 changed by scribu

  • milestone deleted.