1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/10423] Move code into a function and add tests for it

PHPBB3-10423
This commit is contained in:
Oliver Schramm
2014-04-13 21:15:14 +02:00
parent 02378e94e7
commit face175471
4 changed files with 60 additions and 5 deletions

View File

@@ -475,7 +475,7 @@ if ($hilit_words)
{
if (trim($word))
{
$word = preg_replace('#\s+#u', ' ', trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $word)));
$word = phpbb_clean_search_string($word);
$word = str_replace('\*', '\w+?', preg_quote($word, '#'));
$word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word);
$highlight_match .= (($highlight_match != '' && $word != '') ? '|' : '') . $word;