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:
+4
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user