Permalink
Browse files

MDL-19288 fixed one more incorrect use of array_shift() which breaks …

…array keys - thanks Colin Campbell
  • Loading branch information...
1 parent 3d2d030 commit 7ee4f7c57b619704b9fb743da60071823f8f1e01 skodak committed May 24, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 course/lib.php
View
@@ -1183,7 +1183,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];

0 comments on commit 7ee4f7c

Please sign in to comment.