WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/31/2015 03:08:28 AM (4 years ago)
Author:
pento
Message:

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.

Merge of [36128] to the 4.4 branch.

Fixes #35031.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/src/wp-includes/query.php

    r35690 r36129  
    49874987    global $wp_query, $wp_rewrite;
    49884988
     4989    if ( get_queried_object() ) {
     4990        return;
     4991    }
     4992
    49894993    if ( '' !== $wp_query->query_vars['name'] ) :
    49904994        global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.