diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-13 11:00:53 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-01-13 11:00:53 +0000 |
commit | 487f243cbfeabccaba8b308a7f0c2485fdfd0af8 (patch) | |
tree | 82de2104dca05ab4a52cf19cb4b49ec4bb5fa54e | |
parent | 660439856d195fc64e1bdfd36e52eaf0dbf52f2d (diff) | |
download | brdo-487f243cbfeabccaba8b308a7f0c2485fdfd0af8.tar.gz brdo-487f243cbfeabccaba8b308a7f0c2485fdfd0af8.tar.bz2 |
#102040: Fix permissions for search/user
-rw-r--r-- | modules/search/search.module | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/search/search.module b/modules/search/search.module index 70cd29d4d..6df0ed436 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -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, + ); } } |