Skip to content

Commit 45e5a24

Browse files
committed
[HtmlSanitizer] Consider width attribute as safe
1 parent 947492c commit 45e5a24

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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
}

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)