From: skodak Date: Sun, 24 May 2009 07:24:16 +0000 (+0000) Subject: MDL-19288 fixed one more incorrect use of array_shift() which breaks array keys ... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d4ff178fa9434537e71c35acbf9aca61fe0c9578;p=moodle.git MDL-19288 fixed one more incorrect use of array_shift() which breaks array keys - thanks Colin Campbell; merged from MOODLE_19_STABLE --- 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];