Skip to content

Commit

Permalink
fix: formData may contain HTML (eg Labels), need to escape for all da…
Browse files Browse the repository at this point in the history
…taTypes before adding into the code element. JSON is invalid if copy-paste from showData dialog
  • Loading branch information
lucasnetau committed Oct 5, 2023
1 parent 843eca7 commit c6f89d1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,7 @@ export default class Helpers {
* Open a dialog with the form's data
*/
showData() {
let formData = this.getFormData(config.opts.dataType, true)

if (config.opts.dataType === 'xml') {
formData = escapeHtml(formData)
}
const formData = escapeHtml(this.getFormData(config.opts.dataType, true))

const code = m('code', formData, {
className: `formData-${config.opts.dataType}`,
Expand Down

0 comments on commit c6f89d1

Please sign in to comment.