summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2021-02-05 12:24:15 +0000
committerMartin Trigaux <mat@odoo.com>2021-02-05 16:19:19 +0000
commit1e3a11cb5f7a1f07a9e61240f027ff54c0dee847 (patch)
tree176b79791a2f19da8e585aed12ce768ce52ca0c4 /addons/web_editor/static/src/js/editor
parent62c5b8d95c1ba5634e201c0c8a3e2d91fb2305a7 (diff)
[FIX] web_editor: insert record name as text
Previously, the many2one widget from the web_editor used jQuery's '.html()' method when inserting a record name into the page. The record name was not HTML-escaped before this, which may have unexpect result and break the layout. This commit fixes that by using the '.text()' method instead. This bug only affects pages containing a many2one (contact excluded) at the time of selection and not after the selection. e.g. on the /event page, changing the category of an existing event via the website editor closes odoo/odoo#65642 X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index 40da59577a1..52f1bebb023 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -4633,7 +4633,7 @@ registry.many2one = SnippetOptionWidget.extend({
});
});
} else {
- self.$target.html($li.data('name'));
+ self.$target.text($li.data('name'));
}
this._clear();