Skip to content

Commit f5960fc

Browse files
s9y#844 add another regex to avoid boolean operator alone that could lead to error
1 parent b8881a7 commit f5960fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/functions_entries.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') {
882882
$cond['distinct'] = '';
883883
$term = str_replace('"', '"', $term);
884884
$relevance_enabled = true;
885-
if (preg_match('@[\+\-\*~<>\(\)"].[\S]*@', $term)) {
885+
if (preg_match('@[\+\-\*~<>\(\)"].[\S]*@', $term) && preg_match('@\s*[\+\-\*~<>\(\)]\s*$@', $term) === 0 ) {
886886
$cond['find_part'] = "MATCH(title,body,extended) AGAINST('$term' IN BOOLEAN MODE)";
887887
} else {
888888
$cond['find_part'] = "MATCH(title,body,extended) AGAINST('$term')";

0 commit comments

Comments
 (0)