function XssTest::testFilterXSSAdmin
Checks that \Drupal\Component\Utility\Xss::filterAdmin() correctly strips disallowed tags.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ XssTest.php, line 572
Class
- XssTest
- XSS Filtering tests.
Namespace
Drupal\Tests\Component\UtilityCode
public function testFilterXSSAdmin() : void {
$value = Xss::filterAdmin('<style /><iframe /><frame /><frameset /><meta /><link /><embed /><applet /><param /><layer />');
$this->assertEquals('', $value, 'Admin HTML filter -- should never allow some tags.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.