You are here

protected function XssTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::setUp()
  2. 9 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::setUp()

File

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

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);
}