mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +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
f03453c063
1 changed files with 2 additions and 0 deletions
|
@ -289,6 +289,7 @@ class fulltext_native extends \phpbb\search\base
|
||||||
'#(\+|\-)(?:\+|\-)+#',
|
'#(\+|\-)(?:\+|\-)+#',
|
||||||
'#\(\|#',
|
'#\(\|#',
|
||||||
'#\|\)#',
|
'#\|\)#',
|
||||||
|
'#(?<!\s)(\+|\-|\|)#',
|
||||||
);
|
);
|
||||||
$replace = array(
|
$replace = array(
|
||||||
' ',
|
' ',
|
||||||
|
@ -296,6 +297,7 @@ class fulltext_native extends \phpbb\search\base
|
||||||
'$1',
|
'$1',
|
||||||
'(',
|
'(',
|
||||||
')',
|
')',
|
||||||
|
' $1',
|
||||||
);
|
);
|
||||||
|
|
||||||
$keywords = preg_replace($match, $replace, $keywords);
|
$keywords = preg_replace($match, $replace, $keywords);
|
||||||
|
|
Loading…
Add table
Reference in a new issue