You are here

public function XssTest::testQuestionSign in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::testQuestionSign()

Checks that strings starting with a question sign are correctly processed.

File

core/tests/Drupal/Tests/Component/Utility/XssTest.php, line 486
Contains \Drupal\Tests\Component\Utility\XssTest.

Class

XssTest
XSS Filtering tests.

Namespace

Drupal\Tests\Component\Utility

Code

public function testQuestionSign() {
  $value = Xss::filter('<?xml:namespace ns="urn:schemas-microsoft-com:time">');
  $this
    ->assertTrue(stripos($value, '<?xml') === FALSE, 'HTML tag stripping evasion -- starting with a question sign (processing instructions).');
}