Skip to content

Commit

Permalink
chore: update laminas-escaper to ^2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 20, 2023
1 parent 26bc784 commit 2ca516b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
18 changes: 15 additions & 3 deletions system/ThirdParty/Escaper/Escaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<array-key, string> $matches */
function (array $matches): string {
return $this->htmlAttrMatcher($matches);
};
$this->jsMatcher =
/** @param array<array-key, string> $matches */
function (array $matches): string {
return $this->jsMatcher($matches);
};
$this->cssMatcher =
/** @param array<array-key, string> $matches */
function (array $matches): string {
return $this->cssMatcher($matches);
};
}

/**
Expand Down

0 comments on commit 2ca516b

Please sign in to comment.