diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-07-27 10:22:53 +0200 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-07-30 10:14:26 +0200 |
| commit | 1fd430d08fc71bf4205e763c92fd4d77a2c28f72 (patch) | |
| tree | 676cc25b045d7ea82421a2814710cf617cb4bafc | |
| parent | 4517050572d92b16938a3a49c6cec8b52f49b9bc (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.js | 2 |
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 { |
