function locale_test_tokens
Same name in other branches
- 9 core/modules/locale/tests/modules/locale_test/locale_test.module \locale_test_tokens()
- 8.9.x core/modules/locale/tests/modules/locale_test/locale_test.module \locale_test_tokens()
- 11.x core/modules/locale/tests/modules/locale_test/locale_test.module \locale_test_tokens()
Implements hook_tokens().
File
-
core/
modules/ locale/ tests/ modules/ locale_test/ locale_test.module, line 199
Code
function locale_test_tokens($type, $tokens, array $data = [], array $options = []) {
$return = [];
if ($type == 'locale_test') {
foreach ($tokens as $name => $original) {
switch ($name) {
case 'security_test1':
$return[$original] = "javascript:alert('Hello!');";
break;
case 'security_test2':
$return[$original] = "<script>alert('Hello!');</script>";
break;
}
}
}
return $return;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.