MDL-49718 webservices: Fix forced format and force external text cleaning

This commit is contained in:
Juan Leyva
2015-05-06 10:56:17 +08:00
committed by David Monllao
parent 8e8ee75304
commit 77067fbb3a
+3 -4
View File
@@ -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);