Skip to content

Commit

Permalink
Only put brackets round search if OR involved.
Browse files Browse the repository at this point in the history
Otherwise it'll be AND and the brackets aren't needed.
  • Loading branch information
dracos committed May 20, 2015
1 parent a7cd4e2 commit d0f94cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion www/docs/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ function construct_search_string() {

$searchstring = trim($searchstring);
if ($search_main && $searchstring) {
$searchstring = "($search_main) $searchstring";
if (strpos($search_main, 'OR') !== false) {
$search_main = "($search_main)";
}
$searchstring = "$search_main $searchstring";
} elseif ($search_main) {
$searchstring = $search_main;
}
Expand Down

0 comments on commit d0f94cf

Please sign in to comment.