function UrlHelperTest::providerTestStripDangerousProtocols
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestStripDangerousProtocols()
- 8.9.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestStripDangerousProtocols()
- 11.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestStripDangerousProtocols()
Provides data for self::testStripDangerousProtocols().
Return value
array
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ UrlHelperTest.php, line 535
Class
- UrlHelperTest
- @group Utility
Namespace
Drupal\Tests\Component\UtilityCode
public static function providerTestStripDangerousProtocols() {
return [
[
'javascript://example.com',
'//example.com',
[
'http',
'https',
],
],
// Test custom protocols.
[
'http://example.com',
'//example.com',
[
'https',
],
],
// Valid protocol.
[
'http://example.com',
'http://example.com',
[
'https',
'http',
],
],
// Colon not part of the URL scheme.
[
'/test:8888',
'/test:8888',
[
'http',
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.