From ed5bdd6585abe8dbef6bc71d7c0562b6c1fd0333 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 10 Aug 2004 09:16:16 +0000 Subject: [PATCH] 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. --- lib/weblib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.39.5