mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
trim extra spaces before query escape
This commit is contained in:
parent
d6b5f8b210
commit
1f27a7e105
1 changed files with 9 additions and 7 deletions
|
|
@ -140,16 +140,18 @@ switch (true)
|
||||||
// http://sphinxsearch.com/docs/current/extended-syntax.html
|
// http://sphinxsearch.com/docs/current/extended-syntax.html
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Escape special chars
|
|
||||||
$q = @\Manticoresearch\Utils::escape(
|
|
||||||
$q
|
|
||||||
);
|
|
||||||
|
|
||||||
// Remove separator duplicates
|
// Remove separator duplicates
|
||||||
$q = preg_replace(
|
$q = trim(
|
||||||
|
preg_replace(
|
||||||
'/[\s]+/ui',
|
'/[\s]+/ui',
|
||||||
' ',
|
' ',
|
||||||
$q
|
$q
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Escape special chars
|
||||||
|
$q = @\Manticoresearch\Utils::escape(
|
||||||
|
$q
|
||||||
);
|
);
|
||||||
|
|
||||||
// Explode search phrase
|
// Explode search phrase
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue