diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php index 0664f94..522db61 100644 --- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -495,9 +495,14 @@ public function testAttribute($value, $expected, $message, $allowed_tags = NULL) } /** - * Data provider for testFilterXssAdminNotNormalized(). + * Data provider for testAttributes(). */ public function providerTestAttributes() { + $token1 = '[something_looks:like:123:token]'; + $token2 = '[another_token:with1:number]'; + $token3 = '[yet_another:token:432]'; + $token4 = '[running_out:of:token:id3as]'; + return [ [ 'Example: alt', @@ -529,6 +534,44 @@ public function providerTestAttributes() { 'Link tag with numeric data attribute', ['a'] ], + // Test attributes formatted like CSS and breakpoints. + [ + '
', + '
', + 'Section tag with ng- attribute', + ['section'], + ], + [ + '', + '', + 'Source with media containing breakpoints', + ['source'], + ], + // Test attributes formatted like tokens. + [ + '' . $token2 . '', + '' . $token2 . '', + 'Tokens in img tag attributes', + ['img'], + ], + [ + '

Paragraph with ' . $token3 . 'a token inside.

', + '

Paragraph with ' . $token3 . 'a token inside.

', + 'Tokens in p tag attributes and contents', + ['p'], + ], + [ + '' . $token4 . ' plus more', + '' . $token4 . ' plus more', + 'Tokens in a tag attributes and link text', + ['a'], + ], + [ + '' . $token3 . '', + '' . $token3 . '', + 'Tokens in made-up tag attributes', + ['unknown'], + ], ]; }