From: moodler Date: Tue, 10 Aug 2004 09:16:16 +0000 (+0000) Subject: Some filters add javscript, we and certainly do not want to clean X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ed5bdd6585abe8dbef6bc71d7c0562b6c1fd0333;p=moodle.git Some filters add javscript, we and certainly do not want to clean those out. Moving the cleaning to just before the other filters are run. --- diff --git a/lib/weblib.php b/lib/weblib.php index c2d86086c8..edc687d181 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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; }