Skip to content
Snippets Groups Projects
Commit 70c097f2 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Modified patch #43082 by chx: return a 404 when a callback function does not exist.

parent c297f2e0
No related branches found
No related tags found
No related merge requests found
......@@ -337,10 +337,15 @@ function menu_execute_active_handler() {
while ($path && !isset($menu['callbacks'][$path])) {
$path = substr($path, 0, strrpos($path, '/'));
}
if (!isset($menu['callbacks'][$path])) {
return MENU_NOT_FOUND;
}
if (!function_exists($menu['callbacks'][$path]['callback'])) {
return MENU_NOT_FOUND;
}
if (!_menu_item_is_accessible(menu_get_active_item())) {
return MENU_ACCESS_DENIED;
}
......@@ -352,7 +357,7 @@ function menu_execute_active_handler() {
$arguments = array_merge($arguments, explode('/', $arg));
}
return function_exists($menu['callbacks'][$path]['callback']) ? call_user_func_array($menu['callbacks'][$path]['callback'], $arguments) : '';
return call_user_func_array($menu['callbacks'][$path]['callback'], $arguments);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment