RTE: Don't assume "mailto:" protocol in links with "@"

This commit is contained in:
Kenn Jacobsen
2019-03-15 14:02:17 +01:00
committed by Sebastiaan Janssen
parent b367ae6c80
commit 21e91ac4e1

View File

@@ -850,9 +850,10 @@ function tinyMceService($log, imageHelper, $http, $timeout, macroResource, macro
return;
}
// Is email and not //user@domain.com
if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) {
href = 'mailto:' + href;
// Is email and not //user@domain.com and protocol (e.g. mailto:, sip:) is not specified
if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf(':') === -1) {
// assume it's a mailto link
href = 'mailto:' + href;
insertLink();
return;
}