public function XssTest::testFilterXSSAdmin in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::testFilterXSSAdmin()
Checks that \Drupal\Component\Utility\Xss::filterAdmin() correctly strips unallowed tags.
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ XssTest.php, line 542
Class
- XssTest
- XSS Filtering tests.
Namespace
Drupal\Tests\Component\UtilityCode
public function testFilterXSSAdmin() {
$value = Xss::filterAdmin('<style /><iframe /><frame /><frameset /><meta /><link /><embed /><applet /><param /><layer />');
$this
->assertEquals('', $value, 'Admin HTML filter -- should never allow some tags.');
}