Skip to content

Commit 52e37d9

Browse files
committed
chore: bump laminas/laminas-escaper to ^2.19 as minimum
1 parent 45ee15f commit 52e37d9

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

‎admin/framework/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^8.2",
1414
"ext-intl": "*",
1515
"ext-mbstring": "*",
16-
"laminas/laminas-escaper": "^2.18",
16+
"laminas/laminas-escaper": "^2.19",
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^8.2",
1414
"ext-intl": "*",
1515
"ext-mbstring": "*",
16-
"laminas/laminas-escaper": "^2.18",
16+
"laminas/laminas-escaper": "^2.19",
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {

‎system/ThirdParty/Escaper/Escaper.php‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,9 @@ public function __construct(?string $encoding = null)
162162
$this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE;
163163

164164
// set matcher callbacks
165-
$this->htmlAttrMatcher =
166-
/** @param array<array-key, string> $matches */
167-
fn(array $matches): string => $this->htmlAttrMatcher($matches);
168-
$this->jsMatcher =
169-
/** @param array<array-key, string> $matches */
170-
fn(array $matches): string => $this->jsMatcher($matches);
171-
$this->cssMatcher =
172-
/** @param array<array-key, string> $matches */
173-
fn(array $matches): string => $this->cssMatcher($matches);
165+
$this->htmlAttrMatcher = $this->htmlAttrMatcher(...);
166+
$this->jsMatcher = $this->jsMatcher(...);
167+
$this->cssMatcher = $this->cssMatcher(...);
174168
}
175169

176170
/**
@@ -197,7 +191,7 @@ public function escapeHtmlAttr(string $string)
197191
return $string;
198192
}
199193

200-
$result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string);
194+
$result = preg_replace_callback('/[^a-z0-9,\.\-_]/iu', $this->htmlAttrMatcher, $string);
201195
assert(is_string($result));
202196

203197
return $this->fromUtf8($result);
@@ -211,7 +205,7 @@ public function escapeJs(string $string)
211205
return $string;
212206
}
213207

214-
$result = preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string);
208+
$result = preg_replace_callback('/[^a-z0-9,\._]/iu', $this->jsMatcher, $string);
215209
assert(is_string($result));
216210

217211
return $this->fromUtf8($result);
@@ -231,7 +225,7 @@ public function escapeCss(string $string)
231225
return $string;
232226
}
233227

234-
$result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string);
228+
$result = preg_replace_callback('/[^a-z0-9]/iu', $this->cssMatcher, $string);
235229
assert(is_string($result));
236230

237231
return $this->fromUtf8($result);

0 commit comments

Comments
 (0)