Skip to content

Commit

Permalink
Only redirect categories if one "cat" positive integer is specified. …
Browse files Browse the repository at this point in the history
…fixes #8784 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
markjaquith committed Jan 21, 2009
1 parent 711c293 commit 8bdb072
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-includes/canonical.php
Expand Up @@ -119,7 +119,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
} elseif ( is_year() && !empty($_GET['year']) ) {
if ( $redirect_url = get_year_link(get_query_var('year')) )
$redirect['query'] = remove_query_arg('year', $redirect['query']);
} elseif ( is_category() && !empty($_GET['cat']) ) {
} elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) {
if ( $redirect_url = get_category_link(get_query_var('cat')) )
$redirect['query'] = remove_query_arg('cat', $redirect['query']);
} elseif ( is_author() && !empty($_GET['author']) ) {
Expand Down

0 comments on commit 8bdb072

Please sign in to comment.