mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 09:57:38 +01:00
Remove duplicate sentence search terms. Props scribu. fixes #17152
git-svn-id: http://svn.automattic.com/wordpress/trunk@18056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ec8442d890
commit
a7d3ff7df0
@ -2179,9 +2179,6 @@ class WP_Query {
|
||||
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
|
||||
$searchand = ' AND ';
|
||||
}
|
||||
$term = esc_sql( like_escape( $q['s'] ) );
|
||||
if ( empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
|
||||
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
|
||||
|
||||
if ( !empty($search) ) {
|
||||
$search = " AND ({$search}) ";
|
||||
|
Loading…
Reference in New Issue
Block a user