Skip to content

Commit

Permalink
MDL-57273 exporter: Clarify why contextname needs to be PARAM_RAW
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart authored and Damyon Wiese committed Jan 20, 2017
1 parent 547801a commit c59e531
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cohort/classes/external/cohort_summary_exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
);
}
Expand Down
3 changes: 3 additions & 0 deletions competency/classes/external/competency_framework_exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down

0 comments on commit c59e531

Please sign in to comment.