function RequestSanitizerTest::providerTestAcceptableDestinations
Data provider for testing acceptable destinations.
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Security/ RequestSanitizerTest.php, line 317  
Class
- RequestSanitizerTest
 - Tests RequestSanitizer class.
 
Namespace
Drupal\Tests\Core\SecurityCode
public static function providerTestAcceptableDestinations() {
  $data = [];
  // Standard internal example node path is present in the 'destination'
  // parameter.
  $data[] = [
    'node',
  ];
  // Internal path with one leading slash is allowed.
  $data[] = [
    '/example.com',
  ];
  // Internal URL using a colon is allowed.
  $data[] = [
    'example:test',
  ];
  // JavaScript URL is allowed because it is treated as an internal URL.
  $data[] = [
    'javascript:alert(0)',
  ];
  return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.