mirror of
https://github.com/kvazar-network/index-php.git
synced 2025-01-22 12:54:15 +00:00
escape search query by default
This commit is contained in:
parent
0b2088151a
commit
c55b5f5bc3
@ -6,6 +6,7 @@ namespace Kvazar\Index;
|
||||
|
||||
use Manticoresearch\Client;
|
||||
use Manticoresearch\Index;
|
||||
use Manticoresearch\Utils;
|
||||
|
||||
class Manticore
|
||||
{
|
||||
@ -181,11 +182,19 @@ class Manticore
|
||||
?array $filter = [],
|
||||
?array $sort = ['id' => 'desc'],
|
||||
?int $offset = 0,
|
||||
?int $limit = 10
|
||||
?int $limit = 10,
|
||||
?bool $escape = true
|
||||
): array
|
||||
{
|
||||
$records = [];
|
||||
|
||||
if ($escape)
|
||||
{
|
||||
$query = @\Utils::escape(
|
||||
$query
|
||||
);
|
||||
}
|
||||
|
||||
$search = $this->_index->search(
|
||||
$query
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user