public static function UrlHelperTest::providerTestStripDangerousProtocols in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestStripDangerousProtocols()
- 9 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 503
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',
],
],
];
}