Skip to content

Commit

Permalink
MDL-77834 mod_feedback: consistent HTML decoding of answer data.
Browse files Browse the repository at this point in the history
Restores functionality from 72629ee that went missing along the way.
  • Loading branch information
paulholden committed Jun 25, 2024
1 parent 91811a4 commit 8db40a4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions mod/feedback/classes/complete_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ public function add_form_element($item, $element, $addrequiredrule = true, $setd
} else {
// Add non-group element to the form.
if (is_array($element)) {
if ($this->is_frozen() && $element[0] === 'text') {
// Convert 'text' element to 'static' when freezing for better display.
$element = ['static', $element[1], $element[2]];
}
$element = call_user_func_array(array($this->_form, 'createElement'), $element);
}
$element = $this->_form->addElement($element);
Expand All @@ -323,7 +319,7 @@ public function add_form_element($item, $element, $addrequiredrule = true, $setd

// Set default value.
if ($setdefaultvalue && ($tmpvalue = $this->get_item_value($item))) {
$this->_form->setDefault($element->getName(), s($tmpvalue));
$this->_form->setDefault($element->getName(), htmlspecialchars_decode($tmpvalue, ENT_QUOTES));
}

// Freeze if needed.
Expand Down

0 comments on commit 8db40a4

Please sign in to comment.