From d56ba23cd30d70eec2512a8bc0daeb84802375c6 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 7 Jun 2023 19:05:37 +0200 Subject: [PATCH] Fixed search term highlighting Signed-off-by: Janos SUTO --- webui/model/search/message.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webui/model/search/message.php b/webui/model/search/message.php index 44538aa1..4d132ea8 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -198,7 +198,7 @@ class ModelSearchMessage extends Model { 'cc' => $cc, 'subject' => $this->highlight_search_terms($subject, $terms), '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, 'verification' => $this->verification ); @@ -220,11 +220,14 @@ class ModelSearchMessage extends Model { } } + if($html == 0) { + $s = preg_replace("/THE_BREAK_HTML_TAG/", "
", $s); + } + if(count($terms) <= 0) { return $s; } if($html == 0) { foreach($terms as $k => $v) { - $s = preg_replace("/THE_BREAK_HTML_TAG/", "
", $s); $s = preg_replace("/$v/i", "$v", $s); }