From 8eaa4c61d58efd685d09915682e35b0658cd2c97 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 10 Feb 2004 09:59:46 +0000 Subject: [PATCH] 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 --- lib/weblib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 31f230d0f8..3f3bf9c67e 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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(); -- 2.39.5