]> git.mjollnir.org Git - moodle.git/commitdiff
cosmetic fix in format text FORMAT_HTML now used after text is converted to html...
authorskodak <skodak>
Sat, 20 Jan 2007 13:36:03 +0000 (13:36 +0000)
committerskodak <skodak>
Sat, 20 Jan 2007 13:36:03 +0000 (13:36 +0000)
lib/weblib.php

index 3e9cbb2e6d60c6e76c83b1f91f77b3ef3d777abc..ce359890a40854d19a91e78ef567cb155e98e045 100644 (file)
@@ -1234,7 +1234,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
                 replace_smilies($text);
             }
             if (!$options->noclean) {
-                $text = clean_text($text, $format);
+                $text = clean_text($text, FORMAT_HTML);
             }
             if ($options->filter) {
                 $text = filter_text($text, $courseid);
@@ -1242,7 +1242,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
             break;
 
         case FORMAT_PLAIN:
-            $text = s($text);
+            $text = s($text); // cleans dangerous JS
             $text = rebuildnolinktag($text);
             $text = str_replace('  ', '&nbsp; ', $text);
             $text = nl2br($text);
@@ -1262,7 +1262,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
                 replace_smilies($text);
             }
             if (!$options->noclean) {
-                $text = clean_text($text, $format);
+                $text = clean_text($text, FORMAT_HTML);
             }
 
             if ($options->filter) {
@@ -1273,7 +1273,7 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
         default:  // FORMAT_MOODLE or anything else
             $text = text_to_html($text, $options->smiley, $options->para, $options->newlines);
             if (!$options->noclean) {
-                $text = clean_text($text, $format);
+                $text = clean_text($text, FORMAT_HTML);
             }
 
             if ($options->filter) {