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