function XssTest::testFilterNormalizedHtml5
Same name in other branches
- 10 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::testFilterNormalizedHtml5()
Checks that escaped HTML embedded in an attribute is not filtered.
See also
\Drupal\Component\Utility\HtmlSerializerRules
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ XssTest.php, line 616
Class
- XssTest
- XSS Filtering tests.
Namespace
Drupal\Tests\Component\UtilityCode
public function testFilterNormalizedHtml5() : void {
$input = '<span data-caption="foo <em>bar</em>"></span>';
$this->assertEquals($input, Xss::filter(Html::normalize($input), [
'span',
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.