From de49c5afbd4daccda7be11a951eefb15676b7b3a Mon Sep 17 00:00:00 2001 From: bhennes Date: Thu, 13 Feb 2025 15:00:51 +0100 Subject: [PATCH] #44 Change the string split to manage multibyte. As the function appeared in PHP-7.4, the composer PHP minimum version must be 7.4 with mbstring extension. See the issue for the problem it resolves : https://github.com/lyra/plugin-magento/issues/47 --- Helper/Checkout.php | 2 +- composer.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Helper/Checkout.php b/Helper/Checkout.php index 3c9a2bb..33ccb45 100644 --- a/Helper/Checkout.php +++ b/Helper/Checkout.php @@ -461,7 +461,7 @@ private function checkFieldValidity($field, $regex, $fieldName, $addressType, $m return; } - $arr = str_split($invalidChars); + $arr = mb_str_split($invalidChars); $invalidChars = ''; foreach ($arr as $char) { $invalidChars .= '' . $char . ' '; diff --git a/composer.json b/composer.json index 37f7f09..1aa9329 100644 --- a/composer.json +++ b/composer.json @@ -2,8 +2,9 @@ "name" : "lyranetwork/module-payzen", "description" : "PayZen payment platform integration for Magento 2", "require" : { - "php" : "~7|~8" - }, + "php" : "~7.4|~8", + "ext-mbstring": "*" + }, "type" : "magento2-module", "version" : "2.10.0", "license" : "OSL-3.0",