url_is_external

Versions
mediamosa-21
url_is_external($path)

Return TRUE if a path is external (e.g. http://example.com).

▾ 5 functions call url_is_external()

drupal_valid_path in includes/path.inc
Checks a path exists and the current user has access to it.
form_builder in includes/form.inc
Walk through the structured form array, adding any required properties to each element and mapping the incoming input data to the proper elements. Also, execute any #process handlers attached to a specific element.
menu_edit_item_validate in modules/menu/menu.admin.inc
Validate form values for a menu link being added or edited.
menu_link_save in includes/menu.inc
Save a menu link.
shortcut_valid_link in modules/shortcut/shortcut.module
Determines if a path corresponds to a valid shortcut link.

Code

includes/common.inc, line 2078

<?php
function url_is_external($path) {
  $colonpos = strpos($path, ':');
  // Only call the slow filter_xss_bad_protocol if $path contains a ':'
  // before any / ? or #.
  return $colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path);
}
?>