WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6996 closed defect (bug) (fixed)

Attachment permalinks have incorrect trailing slash, do not match canonical URL

Reported by: Sam_a Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.1
Component: General Keywords: has-patch tested get_attachment_link user_trailingslashit redirect_canonical
Focuses: Cc:

Description

When the permalink structure lacks a trailing slash, WordPress generates attachment permalinks with a trailing slash (/attachment-name/), but redirects them to the correct URL (/attachment-name).

Patch fixes the problem by applying user_trailingslashit() in get_attachment_link().

Attachments (1)

get_attachment_link_user_trailingslashit.patch (461 bytes) - added by Sam_a 7 years ago.
Applies user_trailingslashit() in get_attachment_permalink(). Tested successfully in 2.5.1

Download all attachments as: .zip

Change History (6)

@Sam_a7 years ago

Applies user_trailingslashit() in get_attachment_permalink(). Tested successfully in 2.5.1

comment:1 @ryan7 years ago

  • Milestone changed from 2.7 to 2.5.2

comment:2 @ryan7 years ago

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

(In [7954]) Use user_trailingslashit. Props Sam_a. fixes #6996 for 2.5

comment:3 @ryan7 years ago

(In [7955]) Use user_trailingslashit. Props Sam_a. fixes #6996 for trunk

comment:4 @ryan7 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

comment:5 @westi7 years ago

  • Milestone changed from 2.9 to 2.6
Note: See TracTickets for help on using tickets.