url_is_external

Versions
7
url_is_external($path)

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

▾ 5 functions call url_is_external()

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.
menu_valid_path in includes/menu.inc
Validates the path of a menu link being created or edited.
shortcut_valid_link in modules/shortcut/shortcut.module
Determines if a path corresponds to a valid shortcut link.

Code

includes/common.inc, line 2601

<?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);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.