Commit 6020d851 authored by Craig Andrews's avatar Craig Andrews

Don't "hightlight" search terms (by surrounding them in...

Don't "hightlight" search terms (by surrounding them in <strong>$term</strong>) when the term appears in an HTML attribute

parent c77c0d88
......@@ -198,7 +198,7 @@ class SearchNoticeListItem extends NoticeListItem {
$result = preg_replace($pattern, '<strong>\\1</strong>', $text);
/* Remove highlighting from inside links, loop incase multiple highlights in links */
$pattern = '/(href="[^"]*)<strong>('.$options.')<\/strong>([^"]*")/iU';
$pattern = '/(\w+="[^"]*)<strong>('.$options.')<\/strong>([^"]*")/iU';
do {
$result = preg_replace($pattern, '\\1\\2\\3', $result, -1, $count);
} while ($count);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment