Skip to content

Commit

Permalink
MDL-81394 restore: format backup file metadata details safely.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden authored and ilyatregubov committed Aug 7, 2024
1 parent 647b15d commit 0f334dd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions backup/util/ui/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ public function backup_details($details, $nextstageurl) {
$html .= $this->backup_detail_pair(get_string('backupmode', 'backup'), get_string('backupmode'.$details->mode, 'backup'));
$html .= $this->backup_detail_pair(get_string('backupdate', 'backup'), userdate($details->backup_date));
$html .= $this->backup_detail_pair(get_string('moodleversion', 'backup'),
html_writer::tag('span', $details->moodle_release, array('class' => 'moodle_release')).
html_writer::tag('span', '['.$details->moodle_version.']', array('class' => 'moodle_version sub-detail')));
html_writer::tag('span', s($details->moodle_release), array('class' => 'moodle_release')).
html_writer::tag('span', '[' . s($details->moodle_version) .']', array('class' => 'moodle_version sub-detail')));
$html .= $this->backup_detail_pair(get_string('backupversion', 'backup'),
html_writer::tag('span', $details->backup_release, array('class' => 'moodle_release')).
html_writer::tag('span', '['.$details->backup_version.']', array('class' => 'moodle_version sub-detail')));
html_writer::tag('span', s($details->backup_release), array('class' => 'moodle_release')).
html_writer::tag('span', '[' . s($details->backup_version) . ']', array('class' => 'moodle_version sub-detail')));
$html .= $this->backup_detail_pair(get_string('originalwwwroot', 'backup'),
html_writer::tag('span', $details->original_wwwroot, array('class' => 'originalwwwroot')).
html_writer::tag('span', '['.$details->original_site_identifier_hash.']', array('class' => 'sitehash sub-detail')));
html_writer::tag('span', s($details->original_wwwroot), array('class' => 'originalwwwroot')).
html_writer::tag('span', '[' . s($details->original_site_identifier_hash) . ']', array('class' => 'sitehash sub-detail')));
if (!empty($details->include_file_references_to_external_content)) {
$message = '';
if (backup_general_helper::backup_is_samesite($details)) {
Expand Down Expand Up @@ -169,8 +169,8 @@ public function backup_details($details, $nextstageurl) {
$html .= html_writer::start_tag('div', ['class' => 'backup-section',
'role' => 'table', 'aria-labelledby' => 'backupcoursedetailsheader']);
$html .= $this->output->heading(get_string('backupcoursedetails', 'backup'), 2, 'header', 'backupcoursedetailsheader');
$html .= $this->backup_detail_pair(get_string('coursetitle', 'backup'), $details->course->title);
$html .= $this->backup_detail_pair(get_string('courseid', 'backup'), $details->course->courseid);
$html .= $this->backup_detail_pair(get_string('coursetitle', 'backup'), format_string($details->course->title));
$html .= $this->backup_detail_pair(get_string('courseid', 'backup'), clean_param($details->course->courseid, PARAM_INT));

// Warning users about front page backups.
if ($details->original_course_format === 'site') {
Expand All @@ -188,7 +188,7 @@ public function backup_details($details, $nextstageurl) {
} else {
continue;
}
$html .= $this->backup_detail_pair(get_string('backupcoursesection', 'backup', $section->title), $value);
$html .= $this->backup_detail_pair(get_string('backupcoursesection', 'backup', format_string($section->title)), $value);
$table = null;
foreach ($details->activities as $activitykey => $activity) {
if ($activity->sectionid != $section->sectionid) {
Expand All @@ -206,7 +206,7 @@ public function backup_details($details, $nextstageurl) {
$icon = new image_icon('monologo', '', $activity->modulename);
$table->data[] = array(
$this->output->render($icon).$name,
$activity->title,
format_string($activity->title),
($activity->settings[$activitykey.'_userinfo']) ? $yestick : $notick,
);
}
Expand Down

0 comments on commit 0f334dd

Please sign in to comment.