diff --git a/customfield/classes/field_controller.php b/customfield/classes/field_controller.php index 5dc580e8985..3b50809c2f9 100644 --- a/customfield/classes/field_controller.php +++ b/customfield/classes/field_controller.php @@ -255,11 +255,15 @@ abstract class field_controller { /** * Returns the field name formatted according to configuration context. * + * @param bool $escape * @return string */ - public function get_formatted_name(): string { + public function get_formatted_name(bool $escape = true): string { $context = $this->get_handler()->get_configuration_context(); - return format_string($this->get('name'), true, ['context' => $context]); + return format_string($this->get('name'), true, [ + 'context' => $context, + 'escape' => $escape, + ]); } /** diff --git a/customfield/upgrade.txt b/customfield/upgrade.txt index e616039f24d..6eb31adf850 100644 --- a/customfield/upgrade.txt +++ b/customfield/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in /customfield/*, Information provided here is intended especially for developers. +=== 4.4.4 === +* The field controller `get_formatted_name()` method now accepts an optional `$escape` parameter to define whether to + escape the returned name + === 4.4.2 === * The customfield_select field controller `get_options` method now returns each option pre-formatted diff --git a/reportbuilder/classes/local/helpers/custom_fields.php b/reportbuilder/classes/local/helpers/custom_fields.php index 7da71117375..241348da70c 100644 --- a/reportbuilder/classes/local/helpers/custom_fields.php +++ b/reportbuilder/classes/local/helpers/custom_fields.php @@ -172,7 +172,7 @@ class custom_fields { $columns[] = (new column( 'customfield_' . $field->get('shortname'), - new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()), + new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)), $this->entityname )) ->add_joins($this->get_joins()) @@ -261,7 +261,7 @@ class custom_fields { $filter = (new filter( $typeclass, 'customfield_' . $field->get('shortname'), - new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()), + new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)), $this->entityname, $datafieldsql ))