summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2018-07-27 10:22:53 +0200
committerLucas Perais (lpe) <lpe@odoo.com>2018-07-30 10:14:26 +0200
commit1fd430d08fc71bf4205e763c92fd4d77a2c28f72 (patch)
tree676cc25b045d7ea82421a2814710cf617cb4bafc
parent4517050572d92b16938a3a49c6cec8b52f49b9bc (diff)
[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
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js2
1 files changed, 1 insertions, 1 deletions
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 {