diff --git a/webui/model/search/search.php b/webui/model/search/search.php index ba0bdb7e..c0dbbb52 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -247,7 +247,7 @@ class ModelSearchSearch extends Model { if($data['any']) { $data['any'] = $this->fixup_sphinx_operators($data['any']); $data['any'] = $this->fix_email_address_for_sphinx($data['any']); - if($match) { $match = "($match) & "; } $match .= "(" . $data['any'] . ") "; + if($match) { $match = "($match) & "; } $match .= "(@subject,@body" . $data['any'] . ") "; } @@ -277,7 +277,10 @@ class ModelSearchSearch extends Model { } } - $folders = "folder IN (" . implode(",", $__folders) . ") AND "; + if(count($__folders) > 0) { + $folders = "folder IN (" . implode(",", $__folders) . ") AND "; + } + }