mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Backport of David's more efficient code for highlighting
Report any issues where this changes the behaviour of the highlight to the bug tracker git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5812 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1103,9 +1103,8 @@ for($i = 0; $i < $total_posts; $i++)
|
||||
//
|
||||
if ($highlight_match)
|
||||
{
|
||||
// This was shamelessly 'borrowed' from volker at multiartstudio dot de
|
||||
// via php.net's annotated manual
|
||||
$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', addslashes($highlight_match)) . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1));
|
||||
// This has been back-ported from 3.0 CVS
|
||||
$message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*>)#i', '<b style="color:#'.$theme['fontcolor3'].'">\1</b>', $message);
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user