Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 36358)
+++ src/wp-includes/query.php	(working copy)
@@ -3036,6 +3036,14 @@
 			$where .= sprintf( " AND $wpdb->posts.post_password %s ''", $q['has_password'] ? '!=' : '=' );
 		}
 
+		if ( isset( $q['comment_status'] ) && in_array( (string) $q['comment_status'], array( 'open', 'closed' ) ) )  {
+			$where .= $wpdb->prepare( " AND $wpdb->posts.comment_status = %s ", $q['comment_status'] );
+		}
+		
+		if ( isset( $q['ping_status'] ) && in_array( (string) $q['ping_status'], array( 'open', 'closed' ) ) )  {
+			$where .= $wpdb->prepare( " AND $wpdb->posts.ping_status = %s ", $q['ping_status'] );
+		}
+
 		if ( 'any' == $post_type ) {
 			$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
 			if ( empty( $in_search_post_types ) )
