diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2014-04-16 11:08:31 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2014-04-16 11:08:31 +0200 |
| commit | 01030bb3a9dbc158f39a190d2ff187de52e606f4 (patch) | |
| tree | d1052bf785dbb70af81b50fce964ce253f1a8096 /phpBB/search.php | |
| parent | 61f4802b5a40c0d30de8398a058a24baf2cab182 (diff) | |
| parent | b305364b278cb224346a4a98cfdace24b2f3b845 (diff) | |
| download | forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.gz forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.bz2 forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.xz forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.zip | |
Merge branch 'develop-ascraeus' of https://github.com/phpbb/phpbb into ticket/12407
Conflicts:
phpBB/posting.php
Diffstat (limited to 'phpBB/search.php')
| -rw-r--r-- | phpBB/search.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 4756a941f5..44335e2927 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -561,9 +561,9 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // define some vars for urls - $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords)))); - // Do not allow *only* wildcard being used for hilight - $hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit; + // A single wildcard will make the search results look ugly + $hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords)); + $hilit = str_replace(' ', '|', $hilit); $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); $u_show_results = '&sr=' . $show_results; @@ -850,7 +850,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $hilit_array = array_filter(explode('|', $hilit), 'strlen'); foreach ($hilit_array as $key => $value) { - $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($value, '#')); + $hilit_array[$key] = phpbb_clean_search_string($value); + $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#')); $hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]); } $hilit = implode('|', $hilit_array); |
