Merge pull request #219 from edx/matthugs/EDUCATOR-5555-a11y-js-code-for-notes-needs-to-handle-tags-better
Fix XSS vector for a11y text attached to notes editor
This commit is contained in:
@@ -165,7 +165,7 @@
|
||||
.addField({
|
||||
load: function(field, annotation) {
|
||||
if (annotation.text) {
|
||||
$(field).html(HtmlUtils.HTML(Utils.nl2br(annotation.text)).toString());
|
||||
$(field).html(HtmlUtils.HTML(Utils.nl2br(Annotator.Util.escape(annotation.text))).toString());
|
||||
} else {
|
||||
// eslint-disable-next-line max-len
|
||||
$(field).html(HtmlUtils.joinHtml(HtmlUtils.HTML('<i>'), _t('No Comment'), HtmlUtils.HTML('</i>')).toString());
|
||||
|
||||
Reference in New Issue
Block a user