From b24da574e1c34bcf9f1aa13b660baf4c4affc378 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 3 Mar 2011 16:11:26 +0000 Subject: [PATCH] Don't double process the tag query var. Props scribu. fixes #16730 for 3.1 git-svn-id: http://svn.automattic.com/wordpress/branches/3.1@17501 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 663b1c9135..3389232e08 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1654,6 +1654,9 @@ class WP_Query { } foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { + if ( 'post_tag' == $taxonomy ) + continue; // Handled further down in the $q['tag'] block + if ( $t->query_var && !empty( $q[$t->query_var] ) ) { $tax_query_defaults = array( 'taxonomy' => $taxonomy, @@ -1790,7 +1793,7 @@ class WP_Query { } if ( !empty($q['tag_slug__in']) ) { - $q['tag_slug__in'] = array_map('sanitize_title', (array) $q['tag_slug__in']); + $q['tag_slug__in'] = array_map('sanitize_title', array_unique( (array) $q['tag_slug__in'] ) ); $tax_query[] = array( 'taxonomy' => 'post_tag', 'terms' => $q['tag_slug__in'], @@ -1799,7 +1802,7 @@ class WP_Query { } if ( !empty($q['tag_slug__and']) ) { - $q['tag_slug__and'] = array_map('sanitize_title', (array) $q['tag_slug__and']); + $q['tag_slug__and'] = array_map('sanitize_title', array_unique( (array) $q['tag_slug__and'] ) ); $tax_query[] = array( 'taxonomy' => 'post_tag', 'terms' => $q['tag_slug__and'],