mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Strip partial name= parameters when doing canonical redirection on them with default permalinks. props filosofo. fixes #15775
git-svn-id: http://svn.automattic.com/wordpress/trunk@17031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
213100d5ba
commit
de0fc3026a
@ -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