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);
break;
case FORMAT_PLAIN:
- $text = s($text);
+ $text = s($text); // cleans dangerous JS
$text = rebuildnolinktag($text);
$text = str_replace(' ', ' ', $text);
$text = nl2br($text);
replace_smilies($text);
}
if (!$options->noclean) {
- $text = clean_text($text, $format);
+ $text = clean_text($text, FORMAT_HTML);
}
if ($options->filter) {
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) {