Make WordPress Core

Changeset 10396


Ignore:
Timestamp:
01/21/2009 07:47:51 PM (16 years ago)
Author:
markjaquith
Message:

Only redirect categories if one "cat" positive integer is specified. fixes #8784 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r9883 r10396  
    120120            if ( $redirect_url = get_year_link(get_query_var('year')) )
    121121                $redirect['query'] = remove_query_arg('year', $redirect['query']);
    122         } elseif ( is_category() && !empty($_GET['cat']) ) {
     122        } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) {
    123123            if ( $redirect_url = get_category_link(get_query_var('cat')) )
    124124                $redirect['query'] = remove_query_arg('cat', $redirect['query']);
Note: See TracChangeset for help on using the changeset viewer.