Loading core/lib/Drupal/Component/Utility/Xss.php +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ protected static function attributes($attributes) { if (preg_match('/^([-a-zA-Z][-a-zA-Z0-9]*)/', $attributes, $match)) { $attribute_name = strtolower($match[1]); $skip = ( $attribute_name == 'style' || in_array($attribute_name, ['style', 'srcdoc']) || str_starts_with($attribute_name, 'on') || str_starts_with($attribute_name, '-') || // Ignore long attributes to avoid unnecessary processing Loading core/tests/Drupal/Tests/Component/Utility/XssTest.php +6 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,12 @@ public static function providerTestFilterXssNotNormalized() { 'HTML filter -- invalid UTF-8.', ['p'], ], [ '<iframe srcdoc="<script>alert(document.cookie)</script>"></iframe>', 'srcdoc', 'HTML filter attributes removal -- srcdoc attribute.', ['iframe'], ], ]; return $cases; } Loading Loading
core/lib/Drupal/Component/Utility/Xss.php +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ protected static function attributes($attributes) { if (preg_match('/^([-a-zA-Z][-a-zA-Z0-9]*)/', $attributes, $match)) { $attribute_name = strtolower($match[1]); $skip = ( $attribute_name == 'style' || in_array($attribute_name, ['style', 'srcdoc']) || str_starts_with($attribute_name, 'on') || str_starts_with($attribute_name, '-') || // Ignore long attributes to avoid unnecessary processing Loading
core/tests/Drupal/Tests/Component/Utility/XssTest.php +6 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,12 @@ public static function providerTestFilterXssNotNormalized() { 'HTML filter -- invalid UTF-8.', ['p'], ], [ '<iframe srcdoc="<script>alert(document.cookie)</script>"></iframe>', 'srcdoc', 'HTML filter attributes removal -- srcdoc attribute.', ['iframe'], ], ]; return $cases; } Loading