]> git.mjollnir.org Git - moodle.git/commitdiff
fixed format_text caching - now respects text format, current language and course...
authorskodak <skodak>
Sat, 12 Aug 2006 12:44:19 +0000 (12:44 +0000)
committerskodak <skodak>
Sat, 12 Aug 2006 12:44:19 +0000 (12:44 +0000)
lib/weblib.php

index e9f705c963c32bcc3d873e3691e2b8cfab8019c9..b52f080613915f42be7a95f35f5c6bfc05c0ff3a 100644 (file)
@@ -1262,7 +1262,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
 
     if (!empty($CFG->cachetext)) {
         $time = time() - $CFG->cachetext;
-        $md5key = md5($text.'-'.$courseid.$options->noclean.$options->smiley.$options->filter.$options->para.$options->newlines);
+        $md5key = md5($text.'-'.$courseid.$options->noclean.$options->smiley.$options->filter.$options->para.$options->newlines.$format.current_language().$courseid);
         if ($oldcacheitem = get_record_sql('SELECT * FROM '.$CFG->prefix.'cache_text WHERE md5key = \''.$md5key.'\'', true)) {
             if ($oldcacheitem->timemodified >= $time) {
                 return $oldcacheitem->formattedtext;