menu_path_is_external

Definition

menu_path_is_external($path)
includes/menu.inc, line 2389

Description

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

Related topics

Namesort iconDescription
Menu systemDefine the navigation menus, and route page requests to code based on URLs.

Code

<?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);
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.