From d50a246496c8b900148981afa939e2e6eb86adb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Escalante=20=C3=81lvarez?= Date: Thu, 4 Dec 2025 17:15:14 +0100 Subject: [PATCH] Fix empty string check in Category and OrderStatus constructors --- src/BusinessLogic/Domain/GeneralSettings/Models/Category.php | 2 +- src/BusinessLogic/Domain/OrderStatus/Models/OrderStatus.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BusinessLogic/Domain/GeneralSettings/Models/Category.php b/src/BusinessLogic/Domain/GeneralSettings/Models/Category.php index d8610263..f767e5fc 100644 --- a/src/BusinessLogic/Domain/GeneralSettings/Models/Category.php +++ b/src/BusinessLogic/Domain/GeneralSettings/Models/Category.php @@ -30,7 +30,7 @@ class Category */ public function __construct(string $id, string $name) { - if (empty($id) || empty($name)) { + if (trim($id) === '' || trim($name) === '') { throw new EmptyCategoryParameterException( new TranslatableLabel('No parameter can be an empty string.', 'general.errors.empty') ); diff --git a/src/BusinessLogic/Domain/OrderStatus/Models/OrderStatus.php b/src/BusinessLogic/Domain/OrderStatus/Models/OrderStatus.php index c5d766e1..e10d7356 100644 --- a/src/BusinessLogic/Domain/OrderStatus/Models/OrderStatus.php +++ b/src/BusinessLogic/Domain/OrderStatus/Models/OrderStatus.php @@ -30,7 +30,7 @@ class OrderStatus */ public function __construct(string $id, string $name) { - if ($id === "" || empty($name)) { + if (trim($id) === '' || trim($name) === '') { throw new EmptyOrderStatusParameterException( new TranslatableLabel('No parameter can be an empty string.', 'general.errors.empty') );