diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index c870244f3..ca3553a15 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -883,7 +883,8 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') { $term = str_replace('"', '"', $term); $relevance_enabled = true; if (preg_match('@["\+\-\*~<>\(\)]+@', $term)) { - $cond['find_part'] = "MATCH(title,body,extended) AGAINST('$term' IN BOOLEAN MODE)"; + $term = str_replace(['%', '_', '-'], ['\%', '\_', '\-'], $term); + $cond['find_part'] = "MATCH(title,body,extended) AGAINST('\"$term\"' IN BOOLEAN MODE)"; } else { $cond['find_part'] = "MATCH(title,body,extended) AGAINST('$term')"; }