WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/31/2015 03:00:33 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.

Fixes #35031 for trunk.

File:
1 edited

Legend:

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

    r36127 r36128  
    49574957    global $wp_query, $wp_rewrite;
    49584958
     4959    if ( get_queried_object() ) {
     4960        return;
     4961    }
     4962
    49594963    if ( '' !== $wp_query->query_vars['name'] ) :
    49604964        global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.