UrlHelper::externalIsLocal

public static UrlHelper::externalIsLocal($url, $base_url) Determines if an external URL points to this installation. Parameters string $url: A string containing an external URL, such as "http://example.com/foo". string $base_url: The base URL string to check against, such as "http://example.com/" Return value bool TRUE if the URL has the same domain and base path. Throws \InvalidArgumentException Exception thrown when a either $url or $bath_url are not fully qualified. File core/lib/Drupal/C

UrlHelper::filterBadProtocol

public static UrlHelper::filterBadProtocol($string) Processes an HTML attribute value and strips dangerous protocols from URLs. Parameters string $string: The string with the attribute value. Return value string Cleaned up and HTML-escaped version of $string. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 274 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function filterBadProtocol($string) { // Get the plain text r

UrlHelper::filterQueryParameters

public static UrlHelper::filterQueryParameters(array $query, array $exclude = array(), $parent = '') Filters a URL query parameter array to remove unwanted elements. Parameters array $query: An array to be processed. array $exclude: (optional) A list of $query array keys to remove. Use "parent[child]" to exclude nested items. string $parent: Internal use only. Used to build the $query array key for nested items. Return value An array containing query parameters. File core/lib/Drupal/Component

UrlHelper::getAllowedProtocols

public static UrlHelper::getAllowedProtocols() Gets the allowed protocols. Return value array An array of protocols, for example http, https and irc. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 287 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function getAllowedProtocols() { return static::$allowedProtocols; }

UrlHelper::isExternal

public static UrlHelper::isExternal($path) Determines whether a path is external to Drupal. An example of an external path is http://example.com. If a path cannot be assessed by Drupal's menu handler, then we must treat it as potentially insecure. Parameters string $path: The internal path or external URL being linked to, such as "node/34" or "http://example.com/foo". Return value bool TRUE or FALSE, where TRUE indicates an external path. File core/lib/Drupal/Component/Utility/UrlHelper.php,

UrlHelper::isValid

public static UrlHelper::isValid($url, $absolute = FALSE) Verifies the syntax of the given URL. This function should only be used on actual URLs. It should not be used for Drupal menu paths, which can contain arbitrary characters. Valid values per RFC 3986. Parameters string $url: The URL to verify. bool $absolute: Whether the URL is absolute (beginning with a scheme such as "http:"). Return value bool TRUE if the URL is in a valid format, FALSE otherwise. File core/lib/Drupal/Component/Utili

UrlHelper::parse

public static UrlHelper::parse($url) Parses a URL string into its path, query, and fragment components. This function splits both internal paths like node?b=c#d and external URLs like https://example.com/a?b=c#d into their component parts. See RFC 3986 for an explanation of what the component parts are. Note that, unlike the RFC, when passed an external URL, this function groups the scheme, authority, and path together into the path component. Parameters string $url: The internal path or e

UrlHelper::setAllowedProtocols

public static UrlHelper::setAllowedProtocols(array $protocols = array()) Sets the allowed protocols. Parameters array $protocols: An array of protocols, for example http, https and irc. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 297 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function setAllowedProtocols(array $protocols = array()) { static::$allowedProtocols = $protocols; }

UrlHelper::stripDangerousProtocols

public static UrlHelper::stripDangerousProtocols($uri) Strips dangerous protocols (for example, 'javascript:') from a URI. This function must be called for all URIs within user-entered input prior to being output to an HTML attribute value. It is often called as part of \Drupal\Component\Utility\UrlHelper::filterBadProtocol() or \Drupal\Component\Utility\Xss::filter(), but those functions return an HTML-encoded string, so this function can be called independently when the output needs to be a p

UseCacheBackendTrait

Provides methods to use a cache backend while respecting a 'use caches' flag. Hierarchy trait \Drupal\Core\Cache\UseCacheBackendTrait File core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php, line 8 Namespace Drupal\Core\Cache Members Name Modifiers Type Description UseCacheBackendTrait::$cacheBackend protected property Cache backend instance. UseCacheBackendTrait::$useCaches protected property Flag whether caches should be used or skipped. UseCacheBackendTrait