highlighting fix

This commit is contained in:
SJ 2014-08-18 15:35:25 +02:00
parent 1852d90211
commit f2e85c8f18

View File

@ -473,15 +473,15 @@ class ModelSearchMessage extends Model {
private function highlight_search_terms($s = '', $terms = '', $html = 0) { private function highlight_search_terms($s = '', $terms = '', $html = 0) {
$fields = array("from:", "to:", "subject:", "body:"); $fields = array("from:", "to:", "subject:", "body:");
$terms = preg_replace("/(\'|\")/", "", $terms); $terms = preg_replace("/(\'|\"|\=|\>|\<)/", "", $terms);
$a = explode(" ", $terms); $a = explode(" ", $terms);
$terms = array(); $terms = array();
while(list($k, $v) = each($a)) { while(list($k, $v) = each($a)) {
if(strlen($v) >= 3 && !in_array($v, $fields)) { if(strlen($v) >= 3 && !in_array($v, $fields)) {
$v = preg_replace("/\W/", "", $v); //$v = preg_replace("/\W/", "", $v);
array_push($terms, $v); if($v) { array_push($terms, $v); }
} }
} }