? Fixings for menu_router_build().... Switches to a $function call, as well as
? reduces the number of times it needs to play around with the arrays.
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.382
diff -u -p -r1.382 menu.inc
--- includes/menu.inc	12 Mar 2010 05:14:14 -0000	1.382
+++ includes/menu.inc	22 Mar 2010 14:41:51 -0000
@@ -2301,20 +2301,21 @@ function menu_router_build() {
   // a given item came from.
   $callbacks = array();
   foreach (module_implements('menu') as $module) {
-    $router_items = call_user_func($module . '_menu');
-    if (isset($router_items) && is_array($router_items)) {
-      foreach (array_keys($router_items) as $path) {
-        $router_items[$path]['module'] = $module;
-      }
-      $callbacks = array_merge($callbacks, $router_items);
+    $function = $module . '_menu';
+    $router_items = $function();
+    foreach (array_keys($router_items) as $path) {
+      $router_items[$path]['module'] = $module;
     }
+    $callbacks = array_merge($callbacks, $router_items);
   }
   // Alter the menu as defined in modules, keys are like user/%user.
   drupal_alter('menu', $callbacks);
-  list($menu, $masks) = _menu_router_build($callbacks);
-  _menu_router_cache($menu);
 
-  return array($menu, $masks);
+  // Build the router and cache the new menu array from it.
+  $router = _menu_router_build($callbacks);
+  _menu_router_cache($router[0]);
+
+  return $router;
 }
 
 /**
