From 1fd430d08fc71bf4205e763c92fd4d77a2c28f72 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 27 Jul 2018 10:22:53 +0200 Subject: [PATCH] [FIX] web_editor: link creation: @ not necessarily a mailto In the field HTML, click on create hyperlink as its url, put in http://hell-broke-luce.waits/?param=tom@waits.com Before this commit, since the url merely contains a @, it was considered as a mailto: link After this commit, if the url starts with a flavor of http, it is considered as a standard http link OPW 1869087 closes #26012 --- addons/web_editor/static/src/js/widgets/widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 1b0abcecb14..de694e9b9a7 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -1519,7 +1519,7 @@ var LinkDialog = Dialog.extend({ + ((size && size.length) ? (' btn-' + size) : ''); var isNewWindow = this.$('input[name="is_new_window"]').prop('checked'); - if (url.indexOf('@') >= 0 && url.indexOf('mailto:') < 0) { + if (url.indexOf('@') >= 0 && url.indexOf('mailto:') < 0 && !url.match(/^http[s]?/i)) { url = ('mailto:' + url); } return {