]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13661 - fixing incorrect use of array_shift; merged from MOODLE_19_STABLE
authorskodak <skodak>
Mon, 25 Feb 2008 20:22:59 +0000 (20:22 +0000)
committerskodak <skodak>
Mon, 25 Feb 2008 20:22:59 +0000 (20:22 +0000)
lib/weblib.php

index dc7dff5f957ab29181bbd20ee4dcbeada87ebd0b..8bfc570bc37f272abb54f8989a5a035e957e34c9 100644 (file)
@@ -1473,7 +1473,9 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
             if ($oldcacheitem->timemodified >= $time) {
                 if (defined('FULLME') and FULLME == 'cron') {
                     if (count($croncache) > 150) {
-                        array_shift($croncache);
+                        reset($croncache);
+                        $key = key($croncache);
+                        unset($croncache[$key]);
                     }
                     $croncache[$md5key] = $oldcacheitem->formattedtext;
                 }
@@ -1560,7 +1562,9 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
         if (defined('FULLME') and FULLME == 'cron') {
             // special static cron cache - no need to store it in db if its not already there
             if (count($croncache) > 150) {
-                array_shift($croncache);
+                reset($croncache);
+                $key = key($croncache);
+                unset($croncache[$key]);
             }
             $croncache[$md5key] = $text;
             return $text;