MDL-78971 quiz_grading: escape user identity fields on display.

This commit is contained in:
Paul Holden
2023-10-04 02:03:22 +02:00
committed by Jenkins
parent 1d825a95e8
commit ad1990f348
+5 -3
View File
@@ -720,13 +720,15 @@ class quiz_grading_report extends report_base {
$a = new stdClass();
$a->attempt = $attempt->attempt;
$a->fullname = fullname($attempt);
$customfields = [];
foreach ($this->extrauserfields as $field) {
if ($attempt->{s($field)}) {
$customfields[] = $attempt->{s($field)};
if (strval($attempt->{$field}) !== '') {
$customfields[] = s($attempt->{$field});
}
}
$a->customfields = trim(implode(', ', (array)$customfields), ' ,');
$a->customfields = implode(', ', $customfields);
if ($shownames && $showcustomfields) {
return get_string('gradingattemptwithcustomfields', 'quiz_grading', $a);