1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10423] Remove * from search or highlight string

PHPBB3-10423
This commit is contained in:
Oliver Schramm
2014-03-28 21:58:18 +01:00
parent 40ed3f6776
commit 02378e94e7
2 changed files with 7 additions and 5 deletions

View File

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