Skip to content

Commit b691eba

Browse files
committed
minor symfony#52324 [HtmlSanitizer] Consider width attribute as safe (cedric-anne)
This PR was merged into the 6.3 branch. Discussion ---------- [HtmlSanitizer] Consider `width` attribute as safe | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#50153 | License | MIT Consider the HTML attribute `width` to be safe, as attribute `height` already is. Commits ------- 827bd6a [HtmlSanitizer] Consider `width` attribute as safe
2 parents 798a36a + 827bd6a commit b691eba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Component/HtmlSanitizer/Reference/W3CReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ final class W3CReference
394394
'vlink' => false,
395395
'vspace' => true,
396396
'webkitdirectory' => true,
397-
'width' => false,
397+
'width' => true,
398398
'wrap' => true,
399399
];
400400
}

src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ public static function provideSanitizeBody()
427427
'<hr />',
428428
],
429429
[
430-
'<img src="/img/example.jpg" alt="Image alternative text" title="Image title">',
431-
'<img src="/img/example.jpg" alt="Image alternative text" title="Image title" />',
430+
'<img src="/img/example.jpg" alt="Image alternative text" title="Image title" height="150" width="300">',
431+
'<img src="/img/example.jpg" alt="Image alternative text" title="Image title" height="150" width="300" />',
432432
],
433433
[
434434
'<img src="http://trusted.com/img/example.jpg" alt="Image alternative text" title="Image title" />',

0 commit comments

Comments
 (0)