trimmed the highlight regex

git-svn-id: file:///svn/phpbb/trunk@6550 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-11-04 13:37:22 +00:00
parent 8b0ec6e02d
commit 1544f45621
2 changed files with 2 additions and 2 deletions

View file

@ -825,7 +825,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($hilit) if ($hilit)
{ {
// post highlighting // post highlighting
$message = preg_replace('#(?!(?:<(?:s(?:cript|tyle))?)[^<]*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $message); $message = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $message);
} }
$tpl_ary = array( $tpl_ary = array(

View file

@ -1299,7 +1299,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
// Highlight active words (primarily for search) // Highlight active words (primarily for search)
if ($highlight_match) if ($highlight_match)
{ {
$message = preg_replace('#(?!(?:<(?:s(?:cript|tyle))?)[^<]*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">\1</span>', $message); $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">\1</span>', $message);
} }
// Replace naughty words such as farty pants // Replace naughty words such as farty pants