=== modified file 'uc_file/uc_file.module'
--- uc_file/uc_file.module	2009-04-28 16:54:42 +0000
+++ uc_file/uc_file.module	2009-05-06 13:19:16 +0000
@@ -21,8 +21,6 @@
 define('UC_FILE_PAGER_SIZE', 50);
 define('UC_FILE_LIMIT_SENTINEL', -1);
 
-global $cache;
-
 /* **************************************************************************** *
  *  Hook Functions (Drupal)                                                     *
  * **************************************************************************** */
@@ -1549,11 +1547,15 @@
   }
 }
 
+function &_uc_file_get_cache() {
+  static $cache = array();
+}
+
 /**
  * Flush our cache.
  */
 function _uc_file_flush_cache() {
-  global $cache;
+  $cache = _uc_file_get_cache();
 
   $cache = array();
 }
@@ -1567,7 +1569,7 @@
  *   A uc_file object.
  */
 function &uc_file_get_by_name($filename) {
-  global $cache;
+  $cache = _uc_file_get_cache();
 
   if (!isset($cache[$filename])) {
     $cache[$filename] = db_fetch_object(db_query("SELECT * FROM {uc_files} WHERE filename = '%s'", $filename));
@@ -1585,7 +1587,7 @@
  *   A uc_file object.
  */
 function &uc_file_get_by_id($fid) {
-  global $cache;
+  $cache = _uc_file_get_cache();
 
   if (!isset($cache[$fid])) {
     $cache[$fid] = db_fetch_object(db_query("SELECT * FROM {uc_files} WHERE fid = %d", $fid));
@@ -1603,7 +1605,7 @@
  *   A uc_file object.
  */
 function &uc_file_get_by_key($key) {
-  global $cache;
+  $cache = _uc_file_get_cache();
 
   if (!isset($cache[$key])) {
     $cache[$key] = db_fetch_object(db_query("SELECT * FROM {uc_file_users} ufu ".

