MDL-78971 quiz_grading: escape user identity fields on display.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user