q append asterisk

This commit is contained in:
Yuri Kuznetsov
2022-04-14 16:08:40 +03:00
parent 7ca7a1ad18
commit 120f9fd07e
@@ -170,6 +170,19 @@ class SearchParamsFetcher
throw new BadRequest('maxSize must be integer.');
}
/** @var ?string */
$q = $params['q'] ?? null;
if (
$q !== null &&
strpos($q, '*') === false &&
strpos($q, '"') === false &&
strpos($q, '+') === false &&
strpos($q, '-') === false
) {
$params['q'] = $q . '*';
}
$this->handleMaxSize($params);
}