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

This commit is contained in:
Paul Holden
2023-10-04 02:10:16 +02:00
committed by Jenkins
parent a7bdd7a007
commit c25092b232
+5 -3
View File
@@ -727,13 +727,15 @@ class quiz_grading_report extends quiz_default_report {
$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);