function XssTest::providerTestInvalidMultiByte

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

Data provider for testInvalidMultiByte().

Return value

array An array of arrays containing strings:

  • The value to filter.
  • The value to expect after filtering.
  • The assertion message.

See also

testInvalidMultiByte()

File

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

Class

XssTest
XSS Filtering tests.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestInvalidMultiByte() {
    return [
        [
            "Foo\xc0barbaz",
            '',
            'Xss::filter() accepted invalid sequence "Foo\\xC0barbaz"',
        ],
        [
            "Fooÿñ",
            "Fooÿñ",
            'Xss::filter() rejects valid sequence Fooÿñ"',
        ],
        [
            "\xc0aaa",
            '',
            'HTML filter -- overlong UTF-8 sequences.',
        ],
    ];
}

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