1 path.inc _path_is_callback($path)

Verify if the given path is a valid menu callback.

Taken from menu_execute_active_handler().

Parameters

string $path: A string containing a relative path.

Return value

bool: TRUE if the path already exists.

File

core/modules/path/path.inc, line 380
Miscellaneous functions for Path module.

Code

function _path_is_callback($path) {
  $menu = menu_get_item($path);
  if (isset($menu['path']) && $menu['path'] == $path) {
    return TRUE;
  }
  elseif (is_file(BACKDROP_ROOT . '/' . $path) || is_dir(BACKDROP_ROOT . '/' . $path)) {
    // Do not allow existing files or directories to get assigned an automatic
    // alias. Note that we do not need to use is_link() to check for symbolic
    // links since this returns TRUE for either is_file() or is_dir() already.
    return TRUE;
  }
  return FALSE;
}