You are here

public function RequestSanitizerTest::providerTestSanitizedDestinations in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::providerTestSanitizedDestinations()
  2. 10 core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php \Drupal\Tests\Core\Security\RequestSanitizerTest::providerTestSanitizedDestinations()

Data provider for testing sanitized destinations.

File

core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php, line 332

Class

RequestSanitizerTest
Tests RequestSanitizer class.

Namespace

Drupal\Tests\Core\Security

Code

public function providerTestSanitizedDestinations() {
  $data = [];

  // External URL without scheme is not allowed.
  $data[] = [
    '//example.com/test',
  ];

  // External URL is not allowed.
  $data[] = [
    'http://example.com',
  ];
  return $data;
}