From 357b374a7e1be3ab8e3778aeb962bd396fe6f419 Mon Sep 17 00:00:00 2001 From: "Julien (juc) Castiaux" <juc@odoo.com> Date: Mon, 14 Jan 2019 15:26:29 +0000 Subject: [PATCH] [FIX] mail: URL with semi-colon When posting a URL containing a semicolon, odoo stops the link before the semicolon instead of continuing the link to the end although it is a valid characters in URL (see RFC-3986) e.g. the url "example.com&foo;bar" matches "example.com&foo" instead of the whole link opw-1918367 closes odoo/odoo#30198 --- addons/mail/static/src/js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index b4e0c01a23a6..a735d261d93f 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -61,7 +61,7 @@ function _parse_and_transform(nodes, transform_function) { // Suggested URL Javascript regex of http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url // Adapted to make http(s):// not required if (and only if) www. is given. So `should.notmatch` does not match. -var url_regexp = /\b(?:https?:\/\/|(www\.))[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi; +var url_regexp = /\b(?:https?:\/\/|(www\.))[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13}\b([-a-zA-Z0-9@:%_\+.~#?&//=;]*)/gi; function linkify(text, attrs) { attrs = attrs || {}; if (attrs.target === undefined) { -- GitLab