From 0daeb9bf4e1b65a0e3d578d79eb70fc8d104cd8a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 25 Mar 2008 17:47:02 +0000 Subject: [PATCH] Cleanup cat query var git-svn-id: https://develop.svn.wordpress.org/trunk@7511 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/query.php b/wp-includes/query.php index 8f01e65c4b..4fe77538f0 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -990,8 +990,11 @@ class WP_Query { $q['cat'] = ''.urldecode($q['cat']).''; $q['cat'] = addslashes_gpc($q['cat']); $cat_array = preg_split('/[,\s]+/', $q['cat']); + $q['cat'] = ''; + $req_cats = array(); foreach ( $cat_array as $cat ) { $cat = intval($cat); + $req_cats[] = $cat; $in = ($cat > 0); $cat = abs($cat); if ( $in ) { @@ -1002,6 +1005,7 @@ class WP_Query { $q['category__not_in'] = array_merge($q['category__not_in'], get_term_children($cat, 'category')); } } + $q['cat'] = implode(',', $req_cats); } if ( !empty($q['category__in']) || !empty($q['category__not_in']) || !empty($q['category__and']) ) {