]> git.mjollnir.org Git - moodle.git/commitdiff
Partially reversed patch for http://tracker.moodle.org/browse/MDL-5136, caching of...
authorskodak <skodak>
Fri, 22 Sep 2006 18:08:53 +0000 (18:08 +0000)
committerskodak <skodak>
Fri, 22 Sep 2006 18:08:53 +0000 (18:08 +0000)
lib/filelib.php
lib/weblib.php

index eeb2eb3942aedd62014097d787cbf6fb036487e8..c9571ccc90f4c3e985e12ea7d3552370bae33cd4 100644 (file)
@@ -329,7 +329,9 @@ function send_file($path, $filename, $lifetime=86400 , $filter=0, $pathisstring=
             $courseid = SITEID;
         }
         if ($mimetype == 'text/html') {
+            $options = new object();
             $options->noclean = true;
+            $options->nocache = true; // temporary workaround for MDL-5136
             $text = $pathisstring ? $path : implode('', file($path));
             $output = format_text($text, FORMAT_HTML, $options, $courseid);
             if (!empty($CFG->usesid) && empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {
index f10d32abeecb033eb842a52f2ef5f4c9c4d1188e..e38296995b736f88ee4acaf232047311c68e68c2 100644 (file)
@@ -1263,6 +1263,9 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
     if (!isset($options->noclean)) {
         $options->noclean=false;
     }
+    if (!isset($options->nocache)) {
+        $options->nocache=false;
+    }
     if (!isset($options->smiley)) {
         $options->smiley=true;
     }
@@ -1282,7 +1285,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
         }
     }
 
-    if (!empty($CFG->cachetext)) {
+    if (!empty($CFG->cachetext) and empty($options->nocache)) {
         $time = time() - $CFG->cachetext;
         $md5key = md5($text.'-'.$courseid.$options->noclean.$options->smiley.$options->filter.$options->para.$options->newlines.$format.current_language().$courseid.$options->trusttext);
         if ($oldcacheitem = get_record_sql('SELECT * FROM '.$CFG->prefix.'cache_text WHERE md5key = \''.$md5key.'\'', true)) {