function XssTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::setUp()

File

core/tests/Drupal/Tests/Component/Utility/XssTest.php, line 36

Class

XssTest
XSS Filtering tests.

Namespace

Drupal\Tests\Component\Utility

Code

protected function setUp() : void {
    parent::setUp();
    $allowed_protocols = [
        'http',
        'https',
        'ftp',
        'news',
        'nntp',
        'telnet',
        'mailto',
        'irc',
        'ssh',
        'sftp',
        'webcal',
        'rtsp',
    ];
    UrlHelper::setAllowedProtocols($allowed_protocols);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.