Do not do a canonical redirect for negated author query strings. fixes #10960

git-svn-id: http://svn.automattic.com/wordpress/trunk@12034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2009-10-15 09:13:38 +00:00
parent 40e0b16615
commit 398bfcd57d

View File

@ -128,7 +128,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
} elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) { } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) {
if ( $redirect_url = get_category_link(get_query_var('cat')) ) if ( $redirect_url = get_category_link(get_query_var('cat')) )
$redirect['query'] = remove_query_arg('cat', $redirect['query']); $redirect['query'] = remove_query_arg('cat', $redirect['query']);
} elseif ( is_author() && !empty($_GET['author']) ) { } elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
$author = get_userdata(get_query_var('author')); $author = get_userdata(get_query_var('author'));
if ( false !== $author && $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) ) if ( false !== $author && $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) )
$redirect['query'] = remove_query_arg('author', $redirect['author']); $redirect['query'] = remove_query_arg('author', $redirect['author']);