Corrected for space within highlighted words, this is the version running on the main site

git-svn-id: file:///svn/phpbb/trunk@1292 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-11-09 12:32:23 +00:00
parent 32e989d7bd
commit cb427774a6

View file

@ -500,11 +500,14 @@ if( isset($HTTP_GET_VARS['highlight']) )
for($i = 0; $i < count($words); $i++) for($i = 0; $i < count($words); $i++)
{ {
$highlight_match[] = "#\b(" . str_replace("\*", ".*?", preg_quote($words[$i], "#")) . ")\b#i"; if( trim($words[$i] != "" )
$highlight_replace[] = "<font color=\"#FF0000\"><b>\\1</b></font>"; {
$highlight_match[] = "#\b(" . str_replace("\*", ".*?", preg_quote($words[$i], "#")) . ")\b#i";
$highlight_replace[] = "<font color=\"#FF0000\"><b>\\1</b></font>";
}
} }
$highlight_active = ( count($words) ) ? true : false; $highlight_active = ( count($highlight_match) ) ? true : false;
} }
else else