MDL-75656 tag: decode entities in tags element values.

This commit is contained in:
Paul Holden
2022-09-26 10:56:28 +01:00
parent 8f492a836a
commit d2924e641b
+7
View File
@@ -251,6 +251,13 @@ class MoodleQuickForm_tags extends MoodleQuickForm_autocomplete {
return $this->_prepareValue([], $assoc);
}
// Submitted tag data will be encoded, we want original text.
if (array_key_exists($this->getName(), $submitValues)) {
array_walk($submitValues[$this->getName()], static function(string &$tag): void {
$tag = html_entity_decode($tag);
});
}
return parent::exportValue($submitValues, $assoc);
}