[FIX] web_editor: tel url in werkzeug parser
Before 8557bcf the URLs were never rewritten for multilang, which was an error and could duplicated the number of requests on frontend. Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is used to parse the URLs (this is similar to python parsing URL but works in python2 and python3 the same), and in this particular instance it chooses that tel:800800 is website http://tel:800800 and not a telephone number. The problem is when the url uses the uri 'tel:' and only numbers as a phone number, if the user uses the global format for telephone number (with the +) or using a separator for the numbers (e.g. '-' , '/'), in these cases there are no problems parsing the url (phone number RFC: https://tools.ietf.org/html/rfc3966). This commit changes the uri 'tel:' to 'tel://' this one is correctly parsed by the werkzeug library. opw-2029844 closes #34306 closes odoo/odoo#34586 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -2296,7 +2296,7 @@ $.summernote.pluginEvents.backColor = function (event, editor, layoutInfo, backC
|
||||
|
||||
options.onCreateLink = function (sLinkUrl) {
|
||||
if (sLinkUrl.indexOf('mailto:') === 0 || sLinkUrl.indexOf('tel:') === 0) {
|
||||
// pass
|
||||
sLinkUrl = sLinkUrl.replace(/^tel:([0-9]+)$/, 'tel://$1');
|
||||
} else if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) {
|
||||
sLinkUrl = 'mailto:' + sLinkUrl;
|
||||
} else if (sLinkUrl.indexOf('://') === -1 && sLinkUrl[0] !== '/'
|
||||
|
||||
Reference in New Issue
Block a user