Allow cyrillic letters in API filter values (fixes #1296)

This commit is contained in:
Bernd Bestel 2021-07-09 20:23:30 +02:00
parent 11b71e3af2
commit 338a5016cf
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 3 additions and 2 deletions

View File

@ -88,3 +88,4 @@
- Fixed that due soon products with `due_type` = "Expiration date" were missing in `due_products` of the `/stock/volatile` endpoint
- Fixed that `PUT/DELETE /objects/{entity}/{objectId}` produced an internal server error when the given object id was invalid (now returns `400 Bad Request`)
- Fixed that hyphens in filter values did not work
- Fixed that cyrillic letters were not allowed in filter values

View File

@ -12,7 +12,7 @@ class BaseApiController extends BaseController
const PATTERN_OPERATOR = '!?(=|~|<|>|(>=)|(<=)|(§))';
const PATTERN_VALUE = '[A-Za-z_0-9.$#^|-]+';
const PATTERN_VALUE = '[A-Za-z\x{0400}-\x{04FF}_0-9.$#^|-]+';
public function __construct(\DI\Container $container)
{
@ -90,7 +90,7 @@ class BaseApiController extends BaseController
preg_match(
'/(?P<field>' . self::PATTERN_FIELD . ')'
. '(?P<op>' . self::PATTERN_OPERATOR . ')'
. '(?P<value>' . self::PATTERN_VALUE . ')/',
. '(?P<value>' . self::PATTERN_VALUE . ')/u',
$q,
$matches
);