From 82c474d0aea38a57da782c437d1578f07b02037c Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 4 Jul 2021 17:48:58 +0200 Subject: [PATCH] Allow hyphens in API filter value (fixes #1333) --- changelog/62_UNRELEASED_xxxx-xx-xx.md | 1 + controllers/BaseApiController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index 1554d63a..1c9aac34 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -75,3 +75,4 @@ - Added a new API endpoint `/system/localization-strings` to get the localization strings (gettext JSON representation; in the by the user desired language) - 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 diff --git a/controllers/BaseApiController.php b/controllers/BaseApiController.php index 98dd1fb8..2272496c 100644 --- a/controllers/BaseApiController.php +++ b/controllers/BaseApiController.php @@ -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_0-9.$#^|-]+'; public function __construct(\DI\Container $container) {