Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.56.2.4
diff -u -p -r1.56.2.4 install.inc
--- includes/install.inc	16 Feb 2009 10:25:02 -0000	1.56.2.4
+++ includes/install.inc	21 Mar 2011 15:51:03 -0000
@@ -39,17 +39,25 @@ function drupal_load_updates() {
  *   Otherwise, FALSE.
  */
 function drupal_get_schema_versions($module) {
+  static $functions = NULL;
+
+  if (!isset($functions)) {
+    $defined_functions = get_defined_functions();
+    $functions = preg_grep('/_update_/', $defined_functions);
+  }
+
+  $target = $module .'_update_';
+  $offset = strlen($target);
   $updates = array();
-  $functions = get_defined_functions();
-  foreach ($functions['user'] as $function) {
-    if (strpos($function, $module .'_update_') === 0) {
-      $version = substr($function, strlen($module .'_update_'));
+  foreach ($functions as $function) {
+    if (strpos($function, $target) === 0) {
+      $version = substr($function, $offset);
       if (is_numeric($version)) {
         $updates[] = $version;
       }
     }
   }
-  if (count($updates) == 0) {
+  if (empty($updates)) {
     return FALSE;
   }
   sort($updates, SORT_NUMERIC);
