]> git.mjollnir.org Git - moodle.git/commitdiff
Some filters add javscript, we and certainly do not want to clean
authormoodler <moodler>
Tue, 10 Aug 2004 09:16:16 +0000 (09:16 +0000)
committermoodler <moodler>
Tue, 10 Aug 2004 09:16:16 +0000 (09:16 +0000)
those out.

Moving the cleaning to just before the other filters are run.

lib/weblib.php

index c2d86086c8976a99aa92f71bd9fc87e69119b7a1..edc687d18198a714c65575600b64f8fa0ba0d42f 100644 (file)
@@ -609,10 +609,10 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
     switch ($format) {
         case FORMAT_HTML:
             replace_smilies($text);
-            $text = filter_text($text, $courseid);
             if (!isset($options->noclean)) {
                 $text = clean_text($text, $format);
             }
+            $text = filter_text($text, $courseid);
             break;
 
         case FORMAT_PLAIN:
@@ -625,18 +625,18 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
         case FORMAT_WIKI:
             $text = wiki_to_html($text);
             $text = rebuildnolinktag($text);
-            $text = filter_text($text, $courseid);
             if (!isset($options->noclean)) {
                 $text = clean_text($text, $format);
             }
+            $text = filter_text($text, $courseid);
             break;
 
         case FORMAT_MARKDOWN:
             $text = markdown_to_html($text);
-            $text = filter_text($text, $courseid);
             if (!isset($options->noclean)) {
                 $text = clean_text($text, $format);
             }
+            $text = filter_text($text, $courseid);
             break;
 
         default:  // FORMAT_MOODLE or anything else
@@ -650,10 +650,10 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
                 $options->newlines=true;
             }
             $text = text_to_html($text, $options->smiley, $options->para, $options->newlines);
-            $text = filter_text($text, $courseid);
             if (!isset($options->noclean)) {
                 $text = clean_text($text, $format);
             }
+            $text = filter_text($text, $courseid);
             break;
     }