Skip to content

Commit

Permalink
Improved format string.
Browse files Browse the repository at this point in the history
- Fix DASH-645
  • Loading branch information
prasanna-lmsace committed Nov 16, 2023
1 parent b8be78e commit 16e9003
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions classes/local/block_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ public function get_block_content() {
];
if (isset($this->blockinstance->config->header_content)) {
$data['header_content'] = format_text($this->blockinstance->config->header_content['text'],
$this->blockinstance->config->header_content['format']);
$this->blockinstance->config->header_content['format'], ['noclean' => true]);
}

if (isset($this->blockinstance->config->footer_content)) {
$data['footer_content'] = format_text($this->blockinstance->config->footer_content['text'],
$this->blockinstance->config->footer_content['format']);
$this->blockinstance->config->footer_content['format'], ['noclean' => true]);
}

$source->update_data_before_render($data);
Expand Down
2 changes: 1 addition & 1 deletion classes/local/data_grid/data/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function get_name() {
*/
public function get_value() {
if (!filter_var($this->value, FILTER_VALIDATE_URL)) {
return format_text($this->value, FORMAT_HTML);
return format_text($this->value, FORMAT_HTML, ['noclean' => true]);
}
return $this->value;
}
Expand Down
3 changes: 2 additions & 1 deletion classes/local/layout/abstract_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ public function export_for_template(\renderer_base $output) {
'is_totara' => block_dash_is_totara(),
'bootstrap3' => get_config('block_dash', 'bootstrap_version') == 3,
'bootstrap4' => get_config('block_dash', 'bootstrap_version') == 4,
'noresult' => (isset($config->emptystate)) ? format_text($config->emptystate['text'], FORMAT_HTML) : $noresulttxt
'noresult' => (isset($config->emptystate))
? format_text($config->emptystate['text'], FORMAT_HTML, ['noclean' => true]) : $noresulttxt
];

if (!empty($this->get_data_source()->get_all_preferences())) {
Expand Down
3 changes: 2 additions & 1 deletion classes/local/widget/abstract_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function export_for_template($output) {
'is_totara' => block_dash_is_totara(),
'bootstrap3' => get_config('block_dash', 'bootstrap_version') == 3,
'bootstrap4' => get_config('block_dash', 'bootstrap_version') == 4,
'noresult' => isset($config->emptystate['text']) ? format_text($config->emptystate['text'], FORMAT_HTML) : $noresulttxt,
'noresult' => isset($config->emptystate['text'])
? format_text($config->emptystate['text'], FORMAT_HTML, ['noclean' => true]) : $noresulttxt,
'editing' => $PAGE->user_is_editing()
];

Expand Down

0 comments on commit 16e9003

Please sign in to comment.