The text caching is now sensitive on the temporary variable

$CFG->currenttextiscacheable

Any filter can set this to FALSE and the current text will not be cached
This commit is contained in:
moodler 2004-02-10 09:59:46 +00:00
parent a953edbd35
commit 8eaa4c61d5

View File

@ -500,11 +500,13 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
}
if (empty($courseid)) {
if (!empty($course->id)) { // An ugly hack for better compatibility
if (!empty($course->id)) { // An ugly hack for better compatibility
$courseid = $course->id;
}
}
$CFG->currenttextiscacheable = true; // Default status - can be changed by any filter
switch ($format) {
case FORMAT_HTML:
replace_smilies($text);
@ -535,7 +537,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
break;
}
if (!empty($CFG->cachetext)) {
if (!empty($CFG->cachetext) and $CFG->currenttextiscacheable) {
$newrecord->md5key = $md5key;
$newrecord->formattedtext = addslashes($text);
$newrecord->timemodified = time();