Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 17242)
+++ wp-includes/taxonomy.php	(working copy)
@@ -671,8 +671,7 @@
 				$join .= " ON ($primary_table.$primary_id_column = $alias.object_id)";
 
 				$where[] = "$alias.term_taxonomy_id $operator ($terms)";
-			}
-			elseif ( 'NOT IN' == $operator ) {
+			} elseif ( 'NOT IN' == $operator ) {
 
 				if ( empty( $terms ) )
 					continue;
@@ -684,6 +683,21 @@
 					FROM $wpdb->term_relationships
 					WHERE term_taxonomy_id IN ($terms)
 				)";
+			} elseif ( 'AND' == $operator ) {
+
+				if ( empty( $terms ) )
+					continue;
+
+				$num_terms = count( $terms );
+
+				$terms = implode( ',', $terms );
+
+				$where[] = "$primary_table.$primary_id_column IN (
+					SELECT object_id
+					FROM $wpdb->term_relationships
+					WHERE term_taxonomy_id IN ($terms)
+					GROUP BY object_id HAVING COUNT(object_id) = $num_terms
+				)";
 			}
 
 			$i++;
Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 17243)
+++ wp-includes/query.php	(working copy)
@@ -1692,7 +1692,7 @@
 		}
 
 		if ( !empty($q['category__in']) ) {
-			$q['category__in'] = array_unique( $q['category__in'] );
+			$q['category__in'] = array_map('absint', array_unique( $q['category__in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'category',
 				'terms' => $q['category__in'],
@@ -1701,37 +1701,78 @@
 		}
 
 		if ( !empty($q['category__not_in']) ) {
-			$q['category__not_in'] = array_unique( $q['category__not_in'] );
+			$q['category__not_in'] = array_map('absint', array_unique( $q['category__not_in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'category',
 				'terms' => $q['category__not_in'],
-				'operator' => 'NOT IN',
+				'operator' => 'NOT IN'
 			);
 		}
 
+		if ( !empty($q['category__and']) ) {
+			$q['category__and'] = array_map('absint', array_unique( $q['category__and'] ) );
+			$tax_query[] = array(
+				'taxonomy' => 'category',
+				'terms' => $q['category__and'],
+				'field' => 'term_id',
+				'operator' => 'AND'
+			);
+		}
+
 		// Tag stuff
 		if ( !empty($q['tag_id']) ) {
+			$q['tag_id'] = absint( $q['tag_id'] );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
-				'terms' => $q['tag_id'],
+				'terms' => $q['tag_id']
 			);
 		}
 
 		if ( !empty($q['tag__in']) ) {
+			$q['tag__in'] = array_map('absint', array_unique( $q['tag__in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
-				'terms' => $q['tag__in'],
+				'terms' => $q['tag__in']
 			);
 		}
 
 		if ( !empty($q['tag__not_in']) ) {
+			$q['tag__not_in'] = array_map('absint', array_unique( $q['tag__not_in'] ) );
 			$tax_query[] = array(
 				'taxonomy' => 'post_tag',
 				'terms' => $q['tag__not_in'],
-				'operator' => 'NOT IN',
+				'operator' => 'NOT IN'
 			);
 		}
 
+		if ( !empty($q['tag__and']) ) {
+			$q['tag__and'] = array_map('absint', array_unique( $q['tag__and'] ) );
+			$tax_query[] = array(
+				'taxonomy' => 'post_tag',
+				'terms' => $q['tag__and'],
+				'operator' => 'AND'
+			);
+		}
+
+		if ( !empty($q['tag_slug__in']) ) {
+			$q['tag_slug__in'] = array_map('sanitize_title', $q['tag_slug__in']);
+			$tax_query[] = array(
+				'taxonomy' => 'post_tag',
+				'terms' => $q['tag_slug__in'],
+				'field' => 'slug'
+			);
+		}
+
+		if ( !empty($q['tag_slug__and']) ) {
+			$q['tag_slug__and'] = array_map('sanitize_title', $q['tag_slug__and']);
+			$tax_query[] = array(
+				'taxonomy' => 'post_tag',
+				'terms' => $q['tag_slug__and'],
+				'field' => 'slug',
+				'operator' => 'AND'
+			);
+		}
+
 		$this->tax_query = new WP_Tax_Query( $tax_query );
 	}
 
