diff --git a/core/includes/menu.inc b/core/includes/menu.inc index a1c8a01..8026c44 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -775,7 +775,7 @@ function _menu_build_tree($menu_name, array $parameters = array()) { * An array in which to store the collected node links. */ function menu_tree_collect_node_links(&$tree, &$node_links) { - foreach ($tree as $key => $v) { + foreach (array_keys($tree) as $key) { if ($tree[$key]['link']['router_path'] == 'node/%') { $nid = substr($tree[$key]['link']['link_path'], 5); if (is_numeric($nid)) { @@ -811,8 +811,8 @@ function menu_tree_check_access(&$tree, $node_links = array()) { $select->addTag('node_access'); $nids = $select->execute()->fetchCol(); foreach ($nids as $nid) { - foreach ($node_links[$nid] as $mlid => $link) { - $node_links[$nid][$mlid]['access'] = TRUE; + foreach ($node_links[$nid] as &$link) { + $link['access'] = TRUE; } } } @@ -824,7 +824,7 @@ function menu_tree_check_access(&$tree, $node_links = array()) { */ function _menu_tree_check_access(&$tree) { $new_tree = array(); - foreach ($tree as $key => $v) { + foreach (array_keys($tree) as $key) { $item = &$tree[$key]['link']; _menu_link_translate($item); if ($item['access'] || ($item['in_active_trail'] && strpos($item['href'], '%') !== FALSE)) { @@ -1385,7 +1385,7 @@ function menu_set_active_trail($new_trail = NULL) { // a stripped down menu tree containing the active trail only, in case // the given menu has not been built in this request yet. $tree = menu_tree_page_data($preferred_link['menu_name'], NULL, TRUE); - list($key, $curr) = each($tree); + list(, $curr) = each($tree); } // There is no link for the current path. else { @@ -1414,7 +1414,7 @@ function menu_set_active_trail($new_trail = NULL) { } $tree = $curr['below'] ? $curr['below'] : array(); } - list($key, $curr) = each($tree); + list(, $curr) = each($tree); } // Make sure the current page is in the trail to build the page title, by // appending either the preferred link or the menu router item for the