diff options
Diffstat (limited to 'phpBB/search.php')
| -rw-r--r-- | phpBB/search.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 0e5437b27c..e2c68409c3 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -528,9 +528,7 @@ if ($keywords || $author || $search_id || $search_session_id) if ($hilit) { - // This was shamelessly 'borrowed' from volker at multiartstudio dot de - // via php.net's annotated manual - $row['post_text'] = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . str_replace('\\', '\\\\', $hilit) . ")\b#i', '<span class=\"posthilit\">\\\\1</span>', '\\0')", '>' . $row['post_text'] . '<'), 1, -1)); + $row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">\1</span>', $row['post_text']); } $row['post_text'] = smiley_text($row['post_text']); |
