[FIX] website: special character ok in menu label

Edit a website menu label with:

    & < > " ` '

This is what is shown after saving:

   &amp; &lt; &gt; &quot; &#x60; &#x27;

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) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2021-08-02 11:35:51 +00:00
parent b0874bc234
commit 7ea7e79541
+2 -2
View File
@@ -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,
});