WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15775 closed defect (bug) (fixed)

Redirect Name Requests Correctly with Default Permalinks

Reported by: filosofo Owned by: MarkJaquith
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Canonical Keywords: has-patch
Focuses: Cc:

Description

Suppose a post has the slug

an-exciting-post-title

but someone requests

/?name=an-exciting-post

Then redirect_guess_404_permalink() correctly guesses the permalink for that post, but the incorrect, partial name argument is retained:

/?p=123&name=an-exciting-post

and so the posts query fails.

Instead, when redirect_guess_404_permalink() returns a permalink that doesn't have a name argument, the old, incorrect name argument should be removed from the final redirect URL.

Note that in this patch I am using the fix appearing in the patch on #15774, because this patch uses some of the work done there. Applying this patch will also fix #15774.

Attachments (1)

redirect-partial-post-names.15775.diff (960 bytes) - added by filosofo 3 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 nacin3 years ago

  • Owner set to MarkJaquith
  • Status changed from new to assigned

comment:2 markjaquith3 years ago

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

(In [17031]) Strip partial name= parameters when doing canonical redirection on them with default permalinks. props filosofo. fixes #15775

Note: See TracTickets for help on using tickets.