From cb427774a6bcb3169bc0e4cc75b34fcfed245d1e Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 9 Nov 2001 12:32:23 +0000 Subject: [PATCH] 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 --- phpBB/viewtopic.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 658ff56e4a..1bc7ef27d9 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -500,11 +500,14 @@ if( isset($HTTP_GET_VARS['highlight']) ) for($i = 0; $i < count($words); $i++) { - $highlight_match[] = "#\b(" . str_replace("\*", ".*?", preg_quote($words[$i], "#")) . ")\b#i"; - $highlight_replace[] = "\\1"; + if( trim($words[$i] != "" ) + { + $highlight_match[] = "#\b(" . str_replace("\*", ".*?", preg_quote($words[$i], "#")) . ")\b#i"; + $highlight_replace[] = "\\1"; + } } - $highlight_active = ( count($words) ) ? true : false; + $highlight_active = ( count($highlight_match) ) ? true : false; } else