mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Redirects: Prevent redirects if a queried object exists.
After [34659], it became possible to cause an incorrect redirect, by changing the slug of a post, then creating a new post with the old slug. The correct behaviour is to prevent redirecting to the old post. Props dd32, pento. Fixes #35031 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@36128 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4956,6 +4956,10 @@ class WP_Query {
|
||||
function wp_old_slug_redirect() {
|
||||
global $wp_query, $wp_rewrite;
|
||||
|
||||
if ( get_queried_object() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( '' !== $wp_query->query_vars['name'] ) :
|
||||
global $wpdb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user