Skip to content

Commit e641a34

Browse files
committed
Fix tests
1 parent 11d9a17 commit e641a34

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Runtime/EscaperRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function escape($string, string $strategy = 'html', ?string $charset = nu
267267

268268
$regex = match ($strategy) {
269269
'html_attr' => '#[^a-zA-Z0-9,\.\-_]#Su',
270-
'html_attr_relaxed' => '#[^a-zA-Z0-9,\._:@\[\]]#Su',
270+
'html_attr_relaxed' => '#[^a-zA-Z0-9,\.\-_:@\[\]]#Su',
271271
};
272272

273273
$string = preg_replace_callback($regex, function ($matches) {

tests/Runtime/EscaperRuntimeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,11 @@ public function testHtmlAttributeRelaxedEscapingEscapesOwaspRecommendedRanges()
345345
|| $chr >= 0x41 && $chr <= 0x5A
346346
|| $chr >= 0x61 && $chr <= 0x7A) {
347347
$literal = $this->codepointToUtf8($chr);
348-
$this->assertEquals($literal, (new EscaperRuntime())->escape($literal, 'html_attr'));
348+
$this->assertEquals($literal, (new EscaperRuntime())->escape($literal, 'html_attr_relaxed'));
349349
} else {
350350
$literal = $this->codepointToUtf8($chr);
351351
if (\in_array($literal, $immune)) {
352-
$this->assertEquals($literal, (new EscaperRuntime())->escape($literal, 'html_attr'));
352+
$this->assertEquals($literal, (new EscaperRuntime())->escape($literal, 'html_attr_relaxed'));
353353
} else {
354354
$this->assertNotEquals(
355355
$literal,

0 commit comments

Comments
 (0)