From: skodak Date: Sat, 12 Aug 2006 12:44:19 +0000 (+0000) Subject: fixed format_text caching - now respects text format, current language and course... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b8a607d691bd0425881f154e834a6f69dd0e61b2;p=moodle.git fixed format_text caching - now respects text format, current language and course id (lang fix is needed for my multilang filter rewrite ;-); merged from MOODLE_16_STABLE --- diff --git a/lib/weblib.php b/lib/weblib.php index e9f705c963..b52f080613 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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;