diff --git a/system/ThirdParty/Escaper/Escaper.php b/system/ThirdParty/Escaper/Escaper.php index 1e5bc7f9fad9..4fce36bd0c6c 100644 --- a/system/ThirdParty/Escaper/Escaper.php +++ b/system/ThirdParty/Escaper/Escaper.php @@ -4,11 +4,13 @@ namespace Laminas\Escaper; +use function assert; use function bin2hex; use function ctype_digit; use function hexdec; use function htmlspecialchars; use function in_array; +use function is_string; use function mb_convert_encoding; use function ord; use function preg_match; @@ -207,6 +209,8 @@ public function escapeHtmlAttr(string $string) } $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string); + assert(is_string($result)); + return $this->fromUtf8($result); } @@ -229,6 +233,8 @@ public function escapeJs(string $string) } $result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string); + assert(is_string($result)); + return $this->fromUtf8($result); } @@ -258,6 +264,8 @@ public function escapeCss(string $string) } $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string); + assert(is_string($result)); + return $this->fromUtf8($result); }