Sets the allowed protocols.
Parameters
array $protocols:
An array of protocols, for example http, https and irc.
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;
}