mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 00:02:18 +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:
parent
72e95bd7be
commit
aac27e9213
@ -72,6 +72,7 @@ p,ul,td {font-size:10pt;}
|
||||
<li>[Fix] Changes to random number generator code to explicitly truncate the length of the string</li>
|
||||
<li>[Fix] Quoting on boards with HTML enabled</li>
|
||||
<li>[Fix] Redirect to list if cancelling deletion of ranks, smilies or word censors</li>
|
||||
<li>[Change] Backported more efficient highlighting code from Olympus</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user