From c4a150219a10865c78738c76f38595c10d2f3458 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Mon, 13 Apr 2015 14:38:30 +0200 Subject: [PATCH] MDL-49718 webservices: Fix forced format and force external text cleaning --- lib/externallib.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/externallib.php b/lib/externallib.php index d6669321bc4..035ba6346cf 100644 --- a/lib/externallib.php +++ b/lib/externallib.php @@ -725,7 +725,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. @@ -745,9 +745,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); -- 2.36.1