mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Allow cyrillic letters in API filter values (fixes #1296)
This commit is contained in:
parent
11b71e3af2
commit
338a5016cf
@ -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
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user