[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
This commit is contained in:
Lucas Perais (lpe)
2018-07-30 10:14:26 +02:00
parent 4517050572
commit 1fd430d08f
@@ -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 {