Ticket #11330: empty-search-string.2.diff
| File empty-search-string.2.diff, 1.3 KB (added by , 13 years ago) |
|---|
-
wp-includes/query.php
1479 1479 $this->is_single = false; 1480 1480 } else { 1481 1481 // Look for archive queries. Dates, categories, authors, search, post type archives. 1482 1483 if ( !empty($qv['s']) ) { 1482 if ( ! empty( $qv['s'] ) || ( $this->is_main_query() && array_key_exists( 's', $GLOBALS['wp']->query_vars ) ) ) 1484 1483 $this->is_search = true; 1485 }1486 1484 1487 1485 if ( '' !== $qv['second'] ) { 1488 1486 $this->is_time = true; … … 2203 2201 if ( !is_user_logged_in() ) 2204 2202 $search .= " AND ($wpdb->posts.post_password = '') "; 2205 2203 } 2204 } elseif ( $this->is_search ) { 2205 $search = 'AND 0'; 2206 2206 } 2207 2207 2208 2208 // Allow plugins to contextually add/remove/modify the search section of the database query … … 2530 2530 } 2531 2531 2532 2532 // Comments feeds 2533 if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search|| !$this->is_singular ) ) {2533 if ( $this->is_comment_feed && ( $this->is_archive || ( $this->is_search && ! empty( $q['s'] ) ) || !$this->is_singular ) ) { 2534 2534 if ( $this->is_archive || $this->is_search ) { 2535 2535 $cjoin = "JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join "; 2536 2536 $cwhere = "WHERE comment_approved = '1' $where";