diff --git a/admin/framework/composer.json b/admin/framework/composer.json index ab34d89fd260..5a3d1996a840 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -13,7 +13,7 @@ "php": "^8.2", "ext-intl": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.18", + "laminas/laminas-escaper": "^2.19", "psr/log": "^3.0" }, "require-dev": { diff --git a/composer.json b/composer.json index 1ff6b168bed2..8f16ff4058eb 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^8.2", "ext-intl": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.18", + "laminas/laminas-escaper": "^2.19", "psr/log": "^3.0" }, "require-dev": { diff --git a/system/ThirdParty/Escaper/Escaper.php b/system/ThirdParty/Escaper/Escaper.php index 25119a0e5158..fc7a264f5637 100644 --- a/system/ThirdParty/Escaper/Escaper.php +++ b/system/ThirdParty/Escaper/Escaper.php @@ -162,15 +162,9 @@ public function __construct(?string $encoding = null) $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; // set matcher callbacks - $this->htmlAttrMatcher = - /** @param array $matches */ - fn(array $matches): string => $this->htmlAttrMatcher($matches); - $this->jsMatcher = - /** @param array $matches */ - fn(array $matches): string => $this->jsMatcher($matches); - $this->cssMatcher = - /** @param array $matches */ - fn(array $matches): string => $this->cssMatcher($matches); + $this->htmlAttrMatcher = $this->htmlAttrMatcher(...); + $this->jsMatcher = $this->jsMatcher(...); + $this->cssMatcher = $this->cssMatcher(...); } /** @@ -197,7 +191,7 @@ public function escapeHtmlAttr(string $string) return $string; } - $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string); + $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iu', $this->htmlAttrMatcher, $string); assert(is_string($result)); return $this->fromUtf8($result); @@ -211,7 +205,7 @@ public function escapeJs(string $string) return $string; } - $result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string); + $result = preg_replace_callback('/[^a-z0-9,\._]/iu', $this->jsMatcher, $string); assert(is_string($result)); return $this->fromUtf8($result); @@ -231,7 +225,7 @@ public function escapeCss(string $string) return $string; } - $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string); + $result = preg_replace_callback('/[^a-z0-9]/iu', $this->cssMatcher, $string); assert(is_string($result)); return $this->fromUtf8($result);