=== modified file 'includes/menu.inc'
--- includes/menu.inc	2010-11-07 21:51:40 +0000
+++ includes/menu.inc	2010-11-14 18:42:47 +0000
@@ -427,6 +427,13 @@ function menu_get_item($path = NULL, $ro
       cache_set($cid, $router_item, 'cache_menu');
     }
     if ($router_item) {
+      // Allow modules to alter the router item before it is translated.
+      $access_callback = $router_item['access_callback'];
+      $access_arguments = $router_item['access_arguments'];
+      drupal_alter('menu_get_item', $router_item, $path, $original_map);
+      $router_item['access_arguments'] = $access_arguments;
+      $router_item['access_callback'] = $access_callback;
+
       $map = _menu_translate($router_item, $original_map);
       $router_item['original_map'] = $original_map;
       if ($map === FALSE) {

=== modified file 'modules/system/system.api.php'
--- modules/system/system.api.php	2010-11-13 02:00:56 +0000
+++ modules/system/system.api.php	2010-11-14 18:44:39 +0000
@@ -843,6 +843,40 @@ function hook_page_build(&$page) {
 }
 
 /**
+ * Alter a menu router item before it is translated.
+ *
+ * This hook is invoked by menu_get_item() and allows to inspect and alter a
+ * menu router item after it has been retrieved and before it is translated.
+ * The passed in $router_item is statically cached for the current request, so
+ * this hook is only invoked once for any router item that is retrieved via
+ * menu_get_item().
+ *
+ * Changes to access_callback and access_arguments are discarded.
+ *
+ * Usually, modules will only want to inspect the router item and conditionally
+ * perform other actions (such as preparing a state for the current request).
+ * Note that this hook is invoked for any router item that is retrieved by
+ * menu_get_item(), so implementations should check the also passed in $path
+ * when wanting to act on the router item for the current request only.
+ *
+ * @param $router_item
+ *   The menu router item for $path.
+ * @param $path
+ *   The originally passed path, for which $router_item is responsible.
+ * @param $original_map
+ *   The path argument map, as contained in $path.
+ *
+ * @see menu_get_item()
+ */
+function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
+  // When retrieving the router item for the current path...
+  if ($path == $_GET['q']) {
+    // ...call a function that prepares something for this request.
+    mymodule_prepare_something();
+  }
+}
+
+/**
  * Define menu items and page callbacks.
  *
  * This hook enables modules to register paths in order to define how URL

