summaryrefslogtreecommitdiffstats
path: root/wp-includes/query.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-02-22 14:24:41 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-02-22 14:24:41 +0000
commit5fd2feb54c38fc6f357026aadd8abfd224631c26 (patch)
treee656773b126e32d85ba8d9578a6e7e5fff90652a /wp-includes/query.php
parentc463abff16013fb7b011758a314d444278212894 (diff)
downloadwordpress-mu-5fd2feb54c38fc6f357026aadd8abfd224631c26.tar.gz
wordpress-mu-5fd2feb54c38fc6f357026aadd8abfd224631c26.tar.xz
wordpress-mu-5fd2feb54c38fc6f357026aadd8abfd224631c26.zip
WP Merge to 4914
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@896 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/query.php')
-rw-r--r--wp-includes/query.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 01a28a9..b93b5bb 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -765,9 +765,11 @@ class WP_Query {
$searchand = ' AND ';
}
$term = addslashes_gpc($q['s']);
- if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) $search .= " OR (post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}')";
-
- $search = " AND ({$search}) ";
+ if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
+ $search .= " OR (post_title LIKE '{$n}{$term}{$n}') OR (post_content LIKE '{$n}{$term}{$n}')";
+
+ if ( !empty($search) )
+ $search = " AND ({$search}) ";
}
// Category stuff