Strip partial name= parameters when doing canonical redirection on them with default permalinks. props filosofo. fixes #15775
git-svn-id: https://develop.svn.wordpress.org/trunk@17031 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
381f8eeed1
commit
3373f98da0
@ -235,6 +235,15 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
||||
$redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
|
||||
if ( $redirect_url && !empty($redirect['query']) ) {
|
||||
parse_str( $redirect['query'], $_parsed_query );
|
||||
$redirect = @parse_url($redirect_url);
|
||||
|
||||
if ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) {
|
||||
parse_str( $redirect['query'], $_parsed_redirect_query );
|
||||
|
||||
if ( empty( $_parsed_redirect_query['name'] ) )
|
||||
unset( $_parsed_query['name'] );
|
||||
}
|
||||
|
||||
$redirect_url = add_query_arg( $_parsed_query, $redirect_url );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user