aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorOliver Schramm <oliver.schramm97@gmail.com>2014-04-13 21:31:44 +0200
committerOliver Schramm <oliver.schramm97@gmail.com>2014-04-13 21:36:09 +0200
commitdde7ac3b2bcee9832a12255a8df496a67743e2e0 (patch)
tree0608f5693936833d6d11a05d591dd95a66858420 /phpBB
parentface175471b5064117ca57ece53a3403e51e20ba (diff)
downloadforums-dde7ac3b2bcee9832a12255a8df496a67743e2e0.tar
forums-dde7ac3b2bcee9832a12255a8df496a67743e2e0.tar.gz
forums-dde7ac3b2bcee9832a12255a8df496a67743e2e0.tar.bz2
forums-dde7ac3b2bcee9832a12255a8df496a67743e2e0.tar.xz
forums-dde7ac3b2bcee9832a12255a8df496a67743e2e0.zip
[ticket/10423] Match multiple wildcards
Multiple wildcards are removed from the string if there is no word before or after them. If there is a word before or after them, they are just replaced with a single one. PHPBB3-10423
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_content.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 69a29dc31b..19459239d5 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -372,9 +372,9 @@ function phpbb_clean_search_string($search_string)
{
// This regular expressions matches every single wildcard.
// That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string.
- $search_string = preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $search_string);
+ $search_string = preg_replace('#(?<=^|\s)\*+(?=\s|$)#', '', $search_string);
$search_string = trim($search_string);
- $search_string = preg_replace('#\s+#u', ' ', $search_string);
+ $search_string = preg_replace(array('#\s+#u', '#\*+#u'), array(' ', '*'), $search_string);
return $search_string;
}