Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#35189 closed defect (bug) (duplicate)

Redirection based on _wp_old_slug postmeta value should first check if there is an active published post with the same slug!

Reported by: gnotaras Owned by:
Priority: normal Milestone:
Component: Query Version: 4.4
Severity: normal Keywords:
Cc: Focuses:

Description

I happened to find a published post (postA) being permanently redirected to another post (postB).

After doing some research I found out that postB had a postmeta key _wp_old_slug equal to the slug of postA. When I deleted that particular postmeta key/value from the database, everything returned back to normal (no redirection).

This must have started happening lately (during the last months).

Shouldn't it be checked whether there is an active published post with a slug equal to the value of a _wp_old_slug key before performing the actual redirection?

I really have no clue how this postmeta key had been created there in the past. The point is that such a redirection started happening lately and that the way it is done without doing any checks could lead to problems.

Please fix it. Thanks in advance!

Change History (4)

#1 @gnotaras
11 years ago

Also it might be a good idea to never let WP perform permanent redirections by itself, unless it can create a report of such redirections in some way.

#2 @SergeyBiryukov
11 years ago

  • Component General → Query
  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Hi @gnotaras,

Thanks for the report, we're already tracking this issue in #35031.

#3 @gnotaras
11 years ago

Hello Sergey,

Thanks for marking it as duplicate. I had not noticed the other ticket.

BTW, I cannot reproduce this behavior in 4.5-alpha-36033.

Kind Regards,
George

#4 @bronsonquick
11 years ago

#35298 was marked as a duplicate.

Note: See TracTickets for help on using tickets.