From 75efaca796324707f18575dc7cce52b963e247df Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 29 Jun 2021 09:18:06 +0000 Subject: [PATCH] [FIX] web_editor: properly use snippet data in the editor closes odoo/odoo#72947 X-original-commit: ff6d0b16cd32a5ed56a2cc039f5226dc56f6db6a Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index b5978b96efe..afec04f764a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1966,7 +1966,8 @@ var SnippetsMenu = Widget.extend({ .addClass('oe_snippet') .each((i, el) => { const $snippet = $(el); - const name = el.getAttribute('name'); + const name = _.escape(el.getAttribute('name')); + const thumbnailSrc = _.escape(el.dataset.oeThumbnail); const $sbody = $snippet.children().addClass('oe_snippet_body'); const isCustomSnippet = !!el.closest('#snippet_custom'); @@ -1983,7 +1984,7 @@ var SnippetsMenu = Widget.extend({ // Create the thumbnail const $thumbnail = $(`
-
+
${name}
`);