From 7e2fed4ed28da75e8e9bdb5afe612fcde3284a9e Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 15 Sep 2020 14:30:41 +0530 Subject: [PATCH] fix: match multiline scripts and styles --- frappe/public/js/frappe/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/dom.js b/frappe/public/js/frappe/dom.js index 7b59f9da08..6281ff7f76 100644 --- a/frappe/public/js/frappe/dom.js +++ b/frappe/public/js/frappe/dom.js @@ -34,7 +34,7 @@ frappe.dom = { }, remove_script_and_style: function(txt) { const evil_tags = ["script", "style", "noscript", "title", "meta", "base", "head"]; - const regex = new RegExp(evil_tags.map(tag => `<${tag}>.*<\\/${tag}>`).join('|')); + const regex = new RegExp(evil_tags.map(tag => `<${tag}>.*<\\/${tag}>`).join('|'), 's'); if (!regex.test(txt)) { // no evil tags found, skip the DOM method entirely! return txt;