Skip to content

Commit 9815db1

Browse files
committed
Gradebook eval: add remove_xss
1 parent e561531 commit 9815db1

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Diff for: main/gradebook/lib/fe/displaygradebook.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static function display_header_result($evalobj, $selectcat, $page)
8585

8686
$description = '';
8787
if ('' == !$evalobj->get_description()) {
88-
$description = get_lang('Description').' :<b> '.$evalobj->get_description().'</b><br>';
88+
$description = get_lang('Description').' :<b> '.Security::remove_XSS($evalobj->get_description()).'</b><br>';
8989
}
9090

9191
if ($evalobj->get_course_code() == null) {
@@ -95,7 +95,7 @@ public static function display_header_result($evalobj, $selectcat, $page)
9595
}
9696

9797
$evalinfo = '<table width="100%" border="0"><tr><td>';
98-
$evalinfo .= '<h2>'.$evalobj->get_name().'</h2><hr>';
98+
$evalinfo .= '<h2>'.Security::remove_XSS($evalobj->get_name()).'</h2><hr>';
9999
$evalinfo .= $description;
100100
$evalinfo .= get_lang('Course').' :<b> '.$course.'</b><br />';
101101
if (empty($model)) {

Diff for: main/gradebook/lib/fe/evalform.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ private function build_basic_form($edit = 0)
577577
$select_gradebook->addOption(get_lang('Default'), $my_cat->get_id());
578578
$cats_added[] = $my_cat->get_id();
579579
} else {
580-
$select_gradebook->addOption($my_cat->get_name(), $my_cat->get_id());
580+
$select_gradebook->addOption(Security::remove_XSS($my_cat->get_name()), $my_cat->get_id());
581581
$cats_added[] = $my_cat->get_id();
582582
}
583583
} else {

Diff for: main/gradebook/lib/fe/gradebooktable.class.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,11 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
423423

424424
// Name.
425425
if ('Category' === get_class($item)) {
426-
$row[] = $invisibility_span_open.'<strong>'.Security::remove_XSS($item->get_name()).'</strong>'.$invisibility_span_close;
426+
$row[] = $invisibility_span_open.
427+
'<strong>'.Security::remove_XSS($item->get_name()).'</strong>'.$invisibility_span_close;
427428
$main_categories[$item->get_id()]['name'] = $item->get_name();
428429
} else {
429-
$name = $this->build_name_link($item, $type);
430+
$name = Security::remove_XSS($this->build_name_link($item, $type));
430431
$row[] = $invisibility_span_open.$name.$invisibility_span_close;
431432
$main_categories[$item->get_id()]['name'] = $name;
432433
}
@@ -622,7 +623,7 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
622623
$row[] = $this->build_type_column($item, ['style' => 'padding-left:5px']);
623624
// Name.
624625
$row[] = $invisibility_span_open.'&nbsp;&nbsp;&nbsp; '.
625-
$this->build_name_link($item, $type, 4).$invisibility_span_close;
626+
Security::remove_XSS($this->build_name_link($item, $type, 4)).$invisibility_span_close;
626627

627628
// Description.
628629
if (false == $this->exportToPdf) {

Diff for: main/gradebook/lib/fe/resulttable.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ResultTable extends SortableTable
2626
*/
2727
public function __construct(
2828
$evaluation,
29-
$results = [],
29+
$results,
3030
$iscourse,
3131
$addparams = [],
3232
$forprint = false

0 commit comments

Comments
 (0)