mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 19:10:11 +01:00
Fixed search term highlighting
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
6054d4bd2a
commit
d56ba23cd3
@ -198,7 +198,7 @@ class ModelSearchMessage extends Model {
|
|||||||
'cc' => $cc,
|
'cc' => $cc,
|
||||||
'subject' => $this->highlight_search_terms($subject, $terms),
|
'subject' => $this->highlight_search_terms($subject, $terms),
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'message' => $this->message['text/html'] ? $this->message['text/html'] : $this->message['text/plain'],
|
'message' => $this->message['text/html'] ? $this->highlight_search_terms($this->message['text/html']) : $this->highlight_search_terms($this->message['text/plain']),
|
||||||
'has_journal' => $has_journal,
|
'has_journal' => $has_journal,
|
||||||
'verification' => $this->verification
|
'verification' => $this->verification
|
||||||
);
|
);
|
||||||
@ -220,11 +220,14 @@ class ModelSearchMessage extends Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($html == 0) {
|
||||||
|
$s = preg_replace("/THE_BREAK_HTML_TAG/", "<br />", $s);
|
||||||
|
}
|
||||||
|
|
||||||
if(count($terms) <= 0) { return $s; }
|
if(count($terms) <= 0) { return $s; }
|
||||||
|
|
||||||
if($html == 0) {
|
if($html == 0) {
|
||||||
foreach($terms as $k => $v) {
|
foreach($terms as $k => $v) {
|
||||||
$s = preg_replace("/THE_BREAK_HTML_TAG/", "<br />", $s);
|
|
||||||
$s = preg_replace("/$v/i", "<span class=\"mssghglght\">$v</span>", $s);
|
$s = preg_replace("/$v/i", "<span class=\"mssghglght\">$v</span>", $s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user