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) {
// we dynamically add the keywords to the search tabs' paths.
$keys = search_get_keys();
$keys = strlen($keys) ? '/'. $keys : '';
foreach (module_list() as $name) {
if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) {
$items[] = array('path' => 'search/'. $name . $keys, 'title' => $title,
'callback' => 'search_view',
'callback arguments' => array($name),
'access' => user_access('search content'),
'type' => MENU_LOCAL_TASK);
}
foreach (module_implements('search') as $name) {
$title = module_invoke($name, 'search', 'name');
$items[] = array('path' => 'search/'. $name . $keys, 'title' => $title,
'callback' => 'search_view',
'callback arguments' => array($name),
// Only allow access if the search hook returned a valid title.
'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