mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user