diff --git a/cohort/classes/external/cohort_summary_exporter.php b/cohort/classes/external/cohort_summary_exporter.php index f6e7ff8450483..44d8e2521fe89 100644 --- a/cohort/classes/external/cohort_summary_exporter.php +++ b/cohort/classes/external/cohort_summary_exporter.php @@ -61,7 +61,8 @@ public static function define_properties() { public static function define_other_properties() { return array( 'contextname' => array( - 'type' => PARAM_TEXT + // The method context::get_context_name() already formats the string, and may return HTML. + 'type' => PARAM_RAW ), ); } diff --git a/competency/classes/external/competency_framework_exporter.php b/competency/classes/external/competency_framework_exporter.php index 16ed16c4517c0..b9d8120e5c1e6 100644 --- a/competency/classes/external/competency_framework_exporter.php +++ b/competency/classes/external/competency_framework_exporter.php @@ -74,6 +74,9 @@ protected static function define_other_properties() { 'competenciescount' => array( 'type' => PARAM_INT ), + + // Both contexts need to be PARAM_RAW because the method context::get_context_name() + // already applies the formatting and thus could return HTML content. 'contextname' => array( 'type' => PARAM_RAW ),