fixed a html encode problem

This commit is contained in:
SJ 2013-07-03 10:20:29 +02:00
parent 9431f19fd9
commit d0ef91ea72

View File

@ -371,11 +371,15 @@ class ModelSearchMessage extends Model {
private function highlight_search_terms($s = '', $terms = array()) { private function highlight_search_terms($s = '', $terms = array()) {
$terms = preg_replace("/(\'|\")/", "", $terms);
$terms = explode(" ", $terms); $terms = explode(" ", $terms);
if(count($terms) <= 0) { return $s; } if(count($terms) <= 0) { return $s; }
while(list($k, $v) = each($terms)) { while(list($k, $v) = each($terms)) {
if($v == '') { continue; }
$s = preg_replace("/$v/i", "<span class=\"message_highlight\">$v</span>", $s); $s = preg_replace("/$v/i", "<span class=\"message_highlight\">$v</span>", $s);
} }