mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:48:53 +00:00
[ticket/17365] Add spaces before +, -, and | to correct keyword count.
Prevents keyword limit being bypassed with the use of `+`, `-` and `|` in search queries, because $num_keywords depends on spaces to count the number of words.
This commit is contained in:
parent
48a233e415
commit
33b753bd84
1 changed files with 2 additions and 0 deletions
|
@ -289,6 +289,7 @@ class fulltext_native extends \phpbb\search\base
|
|||
'#(\+|\-)(?:\+|\-)+#',
|
||||
'#\(\|#',
|
||||
'#\|\)#',
|
||||
'#(?<!\s)(\+|\-|\|)#',
|
||||
);
|
||||
$replace = array(
|
||||
' ',
|
||||
|
@ -296,6 +297,7 @@ class fulltext_native extends \phpbb\search\base
|
|||
'$1',
|
||||
'(',
|
||||
')',
|
||||
' $1',
|
||||
);
|
||||
|
||||
$keywords = preg_replace($match, $replace, $keywords);
|
||||
|
|
Loading…
Add table
Reference in a new issue