From 7ea7e79541c1264e225c04b60cb2e91088e41d76 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 29 Jul 2021 11:49:38 +0000 Subject: [PATCH] [FIX] website: special character ok in menu label Edit a website menu label with: & < > " ` ' This is what is shown after saving: & < > " ` ' This is happening since ea4dbcd240: characters &, <, >, ", `, and ' are now always escaped. Before that commit, only < and > where escaped and only when an image was inside the label. With this change, we unescape the label when we are editing a menu. opw-2609413 closes odoo/odoo#74558 X-original-commit: ab77054987287444c5f6141b047a63bab4b67baa Signed-off-by: Nicolas Lempereur (nle) --- addons/website/static/src/js/menu/content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/menu/content.js b/addons/website/static/src/js/menu/content.js index c0cadc43f67..63792007f88 100644 --- a/addons/website/static/src/js/menu/content.js +++ b/addons/website/static/src/js/menu/content.js @@ -692,7 +692,7 @@ var EditMenuDialog = weWidgets.Dialog.extend({ var newMenu = { 'fields': { 'id': _.uniqueId('new-'), - 'name': link.content, + 'name': _.unescape(link.content), 'url': link.url, 'new_window': link.isNewWindow, 'is_mega_menu': menuType === 'mega', @@ -738,7 +738,7 @@ var EditMenuDialog = weWidgets.Dialog.extend({ }, menu.fields)); dialog.on('save', this, link => { _.extend(menu.fields, { - 'name': link.content, + 'name': _.unescape(link.content), 'url': link.url, 'new_window': link.isNewWindow, });