1 filter.pages.inc _filter_url_has_protocol($url)

Checks if a URL has a protocol.

Checks for a protocol as a sign that the URL is external. We want to include all external URLs even if they have dangerous protocols.

Parameters

string $url: The URL entered by the user.

Return value

bool: TRUE if URL has protocol.

File

core/modules/filter/filter.pages.inc, line 659
User page callbacks for the Filter module.

Code

function _filter_url_has_protocol($url) {
  // If it has a scheme then it has a protocol.
  if (parse_url($url, PHP_URL_SCHEME)) {
    return TRUE;
  }
  return FALSE;
}