diff --git a/lib/externallib.php b/lib/externallib.php index 56144efcb3a..b2990257eb8 100644 --- a/lib/externallib.php +++ b/lib/externallib.php @@ -712,7 +712,7 @@ function external_validate_format($format) { * All web service servers must set this singleton when parsing the $_GET and $_POST. * * @param string $text The content that may contain ULRs in need of rewriting. - * @param int $textformat The text format, by default FORMAT_HTML. + * @param int $textformat The text format. * @param int $contextid This parameter and the next two identify the file area to use. * @param string $component * @param string $filearea helps identify the file area. @@ -732,9 +732,8 @@ function external_format_text($text, $textformat, $contextid, $component, $filea } if (!$settings->get_raw()) { - $textformat = FORMAT_HTML; // Force format to HTML when not raw. - $text = format_text($text, $textformat, - array('noclean' => true, 'para' => false, 'filter' => $settings->get_filter())); + $text = format_text($text, $textformat, array('para' => false, 'filter' => $settings->get_filter())); + $textformat = FORMAT_HTML; // Once converted to html (from markdown, plain... lets inform consumer this is already HTML). } return array($text, $textformat);