mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 07:07:51 +02:00
Okay, let's give this highlighting preg_ a shot ...
git-svn-id: file:///svn/phpbb/trunk@2066 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
543caeaa4e
commit
39a8a832ca
@ -458,8 +458,8 @@ if( isset($HTTP_GET_VARS['highlight']) )
|
||||
{
|
||||
if( trim($words[$i]) != "" )
|
||||
{
|
||||
$highlight_match[] = "#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($words[$i], "#")) . ")(?!.*?<\/a>)(?!.*?\[/url\])(?!.*?<\/span>)\b#i";
|
||||
$highlight_replace[] = '<span style="color:#' . $theme['fontcolor3'] . '"><b>\\1</b></span>';
|
||||
$highlight_match[] = "#\b(" . str_replace("\*", ".*?", $words[$i]) . ")(?!(.*?".">.*?<)|(.*?\">))\b#i";
|
||||
$highlight_replace[] = '<span style="color:#' . $theme['fontcolor3'] . '"><b>\1</b></span>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -998,15 +998,6 @@ for($i = 0; $i < $total_posts; $i++)
|
||||
// output
|
||||
//
|
||||
|
||||
//
|
||||
// Highlight active words (primarily for search)
|
||||
//
|
||||
if( $highlight_active )
|
||||
{
|
||||
$message = preg_replace($highlight_match, $highlight_replace, $message);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If the board has HTML off but the post has HTML
|
||||
// on then we process it, else leave it alone
|
||||
@ -1046,6 +1037,14 @@ for($i = 0; $i < $total_posts; $i++)
|
||||
}
|
||||
$message = make_clickable($message);
|
||||
|
||||
//
|
||||
// Highlight active words (primarily for search)
|
||||
//
|
||||
if( $highlight_active )
|
||||
{
|
||||
$message = preg_replace($highlight_match, $highlight_replace, $message);
|
||||
}
|
||||
|
||||
//
|
||||
// Replace naughty words
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user