Skip to content

Commit 74e4fa2

Browse files
committed
Security: Exercise: Filter XSS when showing teacher comment
1 parent 5b9a68b commit 74e4fa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/exercise/exercise_history.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
4040
$TBL_EXERCISES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
4141
$TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
42-
Display::display_header($nameTools, 'Exercise');
42+
Display::display_header(get_lang('ViewHistoryChange'), 'Exercise');
4343

4444
if (isset($_GET['message'])) {
4545
if (in_array($_GET['message'], ['ExerciseEdited'])) {
@@ -79,7 +79,7 @@
7979
echo '<td>'.$row['question'].'</td>';
8080
echo '<td>'.$row['marks'].'</td>';
8181
if (!empty($row['teacher_comment'])) {
82-
echo '<td>'.$row['teacher_comment'].'</td>';
82+
echo '<td>'.Security::remove_XSS($row['teacher_comment']).'</td>';
8383
} else {
8484
echo '<td>'.get_lang('WithoutComment').'</td>';
8585
}

0 commit comments

Comments
 (0)