diff -u b/core/includes/menu.inc b/core/includes/menu.inc --- b/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -986,7 +986,7 @@ // Populate the map with any matching values from the request. $path_bits = explode('/', trim($route->getPath(), '/')); - foreach ($map as $index => $map_item) { + foreach (array_keys($map) as $index) { $matches = array(); // Search for placeholders wrapped by curly braces. For example, a path // 'foo/{bar}/baz' would return 'bar'. @@ -1533,7 +1533,7 @@ * 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)) { @@ -1569,7 +1569,7 @@ $select->addTag('node_access'); $nids = $select->execute()->fetchCol(); foreach ($nids as $nid) { - foreach ($node_links[$nid] as $mlid => $link) { + foreach (array_keys($node_links[$nid]) as $mlid) { $node_links[$nid][$mlid]['access'] = TRUE; } } @@ -1582,7 +1582,7 @@ */ 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)) { @@ -2021,7 +2021,6 @@ $actions_current = array(); $next_path = ''; $tab_count = 0; - $action_count = 0; foreach ($children[$path] as $item) { // Local tasks can be normal items too, so bitmask with // MENU_IS_LOCAL_TASK before checking. @@ -2076,7 +2075,6 @@ // Find all tabs at the same level or above the current one. $parent = $router_item['tab_parent']; $path = $router_item['path']; - $current = $router_item; $depth = 1000; while (isset($children[$parent])) { $tabs_current = array(); @@ -2312,7 +2310,7 @@ // 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 { @@ -2342,7 +2340,7 @@ } $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 @@ -2358,7 +2356,7 @@ // 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(, $curr) = each($tree); + list($key, $curr) = each($tree); } // There is no link for the current path. else { @@ -2388,7 +2386,7 @@ } $tree = $curr['below'] ? $curr['below'] : array(); } - list(, $curr) = each($tree); + list($key, $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 @@ -2960,7 +2958,7 @@ } array_multisort($sort, SORT_NUMERIC, $menu); // Apply inheritance rules. - foreach ($menu as $path => $v) { + foreach (array_keys($menu) as $path) { $item = &$menu[$path]; if (!$item['_tab']) { // Non-tab items.