]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19288 fixed one more incorrect use of array_shift() which breaks array keys ...
authorskodak <skodak>
Sun, 24 May 2009 07:24:16 +0000 (07:24 +0000)
committerskodak <skodak>
Sun, 24 May 2009 07:24:16 +0000 (07:24 +0000)
lib/moodlelib.php

index 7702ad35f9587893da7209ea91106fca72b2abde..664d8bf8f5ea1ebd256f5778d8742e9f443df88b 100644 (file)
@@ -2733,7 +2733,9 @@ function &get_fast_modinfo(&$course, $userid=0) {
 
     // Ensure cache does not use too much RAM
     if (count($cache) > MAX_MODINFO_CACHE_SIZE) {
-        array_shift($cache);
+        reset($cache);
+        $key = key($cache);
+        unset($cache[$key]);
     }
 
     return $cache[$course->id];