public static function UrlValidator::setAllowedProtocols

Sets the allowed protocols.

Parameters

array $protocols: An array of protocols, for example http, https and irc.

3 calls to UrlValidator::setAllowedProtocols()
UrlGenerator::__construct in drupal/core/lib/Drupal/Core/Routing/UrlGenerator.php
Constructs a new generator object.
XssTest::setUp in drupal/core/tests/Drupal/Tests/Component/Utility/XssTest.php
_drupal_bootstrap_code in drupal/core/includes/common.inc
Loads code for subsystems and modules, and registers stream wrappers.

File

drupal/core/lib/Drupal/Component/Utility/UrlValidator.php, line 44
Contains \Drupal\Component\Utility\UrlValidator.

Class

UrlValidator
Helper class to support filtering bad protocols from an url.

Namespace

Drupal\Component\Utility

Code

public static function setAllowedProtocols(array $protocols = array()) {
  static::$allowedProtocols = $protocols;
}