function FormattableMarkupKernelTest::providerTestFormattableMarkupUriWithException
Return value
array
File
- 
              core/
tests/ Drupal/ KernelTests/ Component/ Render/ FormattableMarkupKernelTest.php, line 117  
Class
- FormattableMarkupKernelTest
 - Provides a test covering integration of FormattableMarkup with other systems.
 
Namespace
Drupal\KernelTests\Component\RenderCode
public static 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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.