Strip p, page_id, attachment_id, post_type, pagename, and name from redirect query if we get a hit on a 404-guessed permalink. fixes #20374

git-svn-id: http://svn.automattic.com/wordpress/trunk@20380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2012-04-06 19:49:34 +00:00
parent 789b3714d3
commit 2bca2af5fd
1 changed files with 3 additions and 1 deletions

View File

@ -92,8 +92,10 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
}
}
if ( ! $redirect_url )
if ( ! $redirect_url ) {
$redirect_url = redirect_guess_404_permalink( $requested_url );
$redirect['query'] = remove_query_arg( array( 'p', 'page_id', 'attachment_id', 'post_type', 'pagename', 'name' ), $redirect['query'] );
}
} elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) {
// rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101