WordPress.org

Make WordPress Core

Changeset 17031


Ignore:
Timestamp:
12/17/10 20:57:03 (3 years ago)
Author:
markjaquith
Message:

Strip partial name= parameters when doing canonical redirection on them with default permalinks. props filosofo. fixes #15775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r17030 r17031  
    236236    if ( $redirect_url && !empty($redirect['query']) ) { 
    237237        parse_str( $redirect['query'], $_parsed_query ); 
     238        $redirect = @parse_url($redirect_url); 
     239 
     240        if ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) { 
     241            parse_str( $redirect['query'], $_parsed_redirect_query ); 
     242 
     243            if ( empty( $_parsed_redirect_query['name'] ) ) 
     244                unset( $_parsed_query['name'] ); 
     245        } 
     246 
    238247        $redirect_url = add_query_arg( $_parsed_query, $redirect_url ); 
    239248    } 
Note: See TracChangeset for help on using the changeset viewer.