From c7f95720199de441e70fde1b8aa402aa04550e1d Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 21 Oct 2023 08:04:26 +0900 Subject: [PATCH] chore: update laminas-escaper to ^2.13 --- admin/framework/composer.json | 2 +- composer.json | 2 +- system/ThirdParty/Escaper/Escaper.php | 18 +++++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/admin/framework/composer.json b/admin/framework/composer.json index 44fbb67591c0..20370da43686 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -14,7 +14,7 @@ "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.9", + "laminas/laminas-escaper": "^2.13", "psr/log": "^2.0" }, "require-dev": { diff --git a/composer.json b/composer.json index 6510a6872599..5fd53c55925f 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.9", + "laminas/laminas-escaper": "^2.13", "psr/log": "^2.0" }, "require-dev": { diff --git a/system/ThirdParty/Escaper/Escaper.php b/system/ThirdParty/Escaper/Escaper.php index d6a02e14c9be..c4964cb55e4a 100644 --- a/system/ThirdParty/Escaper/Escaper.php +++ b/system/ThirdParty/Escaper/Escaper.php @@ -157,9 +157,21 @@ public function __construct(?string $encoding = null) $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; // set matcher callbacks - $this->htmlAttrMatcher = [$this, 'htmlAttrMatcher']; - $this->jsMatcher = [$this, 'jsMatcher']; - $this->cssMatcher = [$this, 'cssMatcher']; + $this->htmlAttrMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->htmlAttrMatcher($matches); + }; + $this->jsMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->jsMatcher($matches); + }; + $this->cssMatcher = + /** @param array $matches */ + function (array $matches): string { + return $this->cssMatcher($matches); + }; } /**