Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.209
diff -u -9 -p -r1.209 module.inc
--- includes/module.inc	27 Nov 2010 20:41:38 -0000	1.209
+++ includes/module.inc	13 Dec 2010 23:50:22 -0000
@@ -664,19 +664,19 @@ function module_implements($hook, $sort 
     }
   }
 
   if (!isset($implementations[$hook])) {
     // The hook is not cached, so ensure that whether or not it has
     // implementations, that the cache is updated at the end of the request.
     $implementations['#write_cache'] = TRUE;
     $hook_info = module_hook_info();
     $implementations[$hook] = array();
-    $list = module_list(FALSE, FALSE, $sort);
+    $list = module_list(FALSE, FALSE);
     foreach ($list as $module) {
       $include_file = isset($hook_info[$hook]['group']) && module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']);
       // Since module_hook() may needlessly try to load the include file again,
       // function_exists() is used directly here.
       if (function_exists($module . '_' . $hook)) {
         $implementations[$hook][$module] = $include_file ? $hook_info[$hook]['group'] : FALSE;
       }
     }
     // Allow modules to change the weight of specific implementations but avoid
@@ -700,19 +700,23 @@ function module_implements($hook, $sort 
       if (!function_exists($module . '_' . $hook)) {
         // Clear out the stale implementation from the cache and force a cache
         // refresh to forget about no longer existing hook implementations.
         unset($implementations[$hook][$module]);
         $implementations['#write_cache'] = TRUE;
       }
     }
   }
 
-  return array_keys($implementations[$hook]);
+  $modules = array_keys($implementations[$hook]);
+  if ($sort) {
+    sort($modules);
+  }
+  return $modules;
 }
 
 /**
  * Retrieve a list of what hooks are explicitly declared.
  */
 function module_hook_info() {
   // This function is indirectly invoked from bootstrap_invoke_all(), in which
   // case common.inc, subsystems, and modules are not loaded yet, so it does not
   // make sense to support hook groups resp. lazy-loaded include files prior to
