formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.89k stars 1.06k forks source link

FIO-7544: Fixes an issue where scripts inside HTML component will be executed during interpolation #5418

Closed alexandraRamanenka closed 10 months ago

alexandraRamanenka commented 11 months ago

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-7544

Description

What changed?

Previously, formio.js was sanitizing the HTML component's content at the end of get content(), but since interpolate() method uses translateHTMLTemplate utility function that creates a DOM element and sets a content inside it, we need to sanitize the content before it goes there.

Dependencies

This PR depends on the following PRs from other Form.io modules: ...

How has this PR been tested?

I added automated tests to cover [all/the following] cases, including ...

Checklist: