menu_path_is_external

Versions
6
menu_path_is_external($path)

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

Related topics

▾ 3 functions call menu_path_is_external()

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.

Code

includes/menu.inc, line 2455

<?php
function menu_path_is_external($path) {
  $colonpos = strpos($path, ':');
  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.