MDL-19288 fixed one more incorrect use of array_shift() which breaks array keys - thanks Colin Campbell; merged from MOODLE_19_STABLE
This commit is contained in:
+3
-1
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user