mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
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:
parent
a953edbd35
commit
8eaa4c61d5
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user