diff options
| author | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-03-28 21:58:18 +0100 |
|---|---|---|
| committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-03-28 22:28:14 +0100 |
| commit | 02378e94e779bbd407ef86166884c00e32d152fc (patch) | |
| tree | b554c42d37bf174335a09ff6f3129cdaaf9583d1 /phpBB/viewtopic.php | |
| parent | 40ed3f677699f2d9801bb75168e84766c35722f4 (diff) | |
| download | forums-02378e94e779bbd407ef86166884c00e32d152fc.tar forums-02378e94e779bbd407ef86166884c00e32d152fc.tar.gz forums-02378e94e779bbd407ef86166884c00e32d152fc.tar.bz2 forums-02378e94e779bbd407ef86166884c00e32d152fc.tar.xz forums-02378e94e779bbd407ef86166884c00e32d152fc.zip | |
[ticket/10423] Remove * from search or highlight string
PHPBB3-10423
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e08d6e1ef5..4c9302dbbe 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -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; } } |
