public function FormattableMarkupKernelTest::providerTestFormattableMarkupUriWithException in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::providerTestFormattableMarkupUriWithException()
- 10 core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::providerTestFormattableMarkupUriWithException()
Return value
array
File
- core/
tests/ Drupal/ KernelTests/ Component/ Render/ FormattableMarkupKernelTest.php, line 124
Class
- FormattableMarkupKernelTest
- Provides a test covering integration of FormattableMarkup with other systems.
Namespace
Drupal\KernelTests\Component\RenderCode
public function providerTestFormattableMarkupUriWithException() {
$data = [];
$data['js-protocol'] = [
'Hey giraffe <a href=":url">MUUUH</a>',
"javascript:alert('xss')",
];
$data['js-with-fromCharCode'] = [
'Hey giraffe <a href=":url">MUUUH</a>',
"javascript:alert(String.fromCharCode(88,83,83))",
];
$data['non-url-with-colon'] = [
'Hey giraffe <a href=":url">MUUUH</a>',
"llamas: they are not URLs",
];
$data['non-url-with-html'] = [
'Hey giraffe <a href=":url">MUUUH</a>',
'<span>not a url</span>',
];
return $data;
}