From: Craig Andrews Date: Tue, 8 Sep 2009 02:36:01 +0000 (-0400) Subject: Don't "hightlight" search terms (by surrounding them in $term) when... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6020d85191bdd838acbeb40ab17035e378b0aee1;p=quix0rs-gnu-social.git Don't "hightlight" search terms (by surrounding them in $term) when the term appears in an HTML attribute Fixes http://status.net/trac/ticket/1852 --- diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 1cd987df39..69dcd1a46c 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -198,7 +198,7 @@ class SearchNoticeListItem extends NoticeListItem { $result = preg_replace($pattern, '\\1', $text); /* Remove highlighting from inside links, loop incase multiple highlights in links */ - $pattern = '/(href="[^"]*)('.$options.')<\/strong>([^"]*")/iU'; + $pattern = '/(\w+="[^"]*)('.$options.')<\/strong>([^"]*")/iU'; do { $result = preg_replace($pattern, '\\1\\2\\3', $result, -1, $count); } while ($count);