Commit 487f243c authored by Steven Wittens's avatar Steven Wittens
Browse files

#102040: Fix permissions for search/user

parent 66043985
...@@ -169,14 +169,15 @@ function search_menu($may_cache) { ...@@ -169,14 +169,15 @@ function search_menu($may_cache) {
// we dynamically add the keywords to the search tabs' paths. // we dynamically add the keywords to the search tabs' paths.
$keys = search_get_keys(); $keys = search_get_keys();
$keys = strlen($keys) ? '/'. $keys : ''; $keys = strlen($keys) ? '/'. $keys : '';
foreach (module_list() as $name) { foreach (module_implements('search') as $name) {
if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) { $title = module_invoke($name, 'search', 'name');
$items[] = array('path' => 'search/'. $name . $keys, 'title' => $title, $items[] = array('path' => 'search/'. $name . $keys, 'title' => $title,
'callback' => 'search_view', 'callback' => 'search_view',
'callback arguments' => array($name), 'callback arguments' => array($name),
'access' => user_access('search content'), // Only allow access if the search hook returned a valid title.
'type' => MENU_LOCAL_TASK); 'access' => user_access('search content') && $title,
} 'type' => MENU_LOCAL_TASK,
);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment