From c6f89d1847c4dbd4a80c6ad2b43332f1f4e01ded Mon Sep 17 00:00:00 2001 From: James Lucas Date: Thu, 5 Oct 2023 16:26:11 +1100 Subject: [PATCH] fix: formData may contain HTML (eg Labels), need to escape for all dataTypes before adding into the code element. JSON is invalid if copy-paste from showData dialog --- src/js/helpers.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/js/helpers.js b/src/js/helpers.js index 4d89cb485..0860b316d 100644 --- a/src/js/helpers.js +++ b/src/js/helpers.js @@ -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}`,