From d4ff178fa9434537e71c35acbf9aca61fe0c9578 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 24 May 2009 07:24:16 +0000 Subject: [PATCH] MDL-19288 fixed one more incorrect use of array_shift() which breaks array keys - thanks Colin Campbell; merged from MOODLE_19_STABLE --- lib/moodlelib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 7702ad35f9..664d8bf8f5 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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]; -- 2.39.5