diff options
| author | Goffin Simon <sig@odoo.com> | 2015-12-18 13:42:42 +0100 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2015-12-22 10:34:18 +0100 |
| commit | f7dab86a06ebd1669d7d2041ff843db33f5d7de6 (patch) | |
| tree | 785616a3e53528c7e50e545bb85c4b976c2acd78 | |
| parent | 9f795ef2956c95aba094a455e68aacc5a6cdcd88 (diff) | |
[FIX] tools: colon in a URL
When writing an URL in the chatter with a colon inside, the function
"html_keep_url" must detect all the URL.
opw:660116
| -rw-r--r-- | openerp/tools/mail.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 2e44cfc7395..cd18ebd8fa1 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -484,7 +484,7 @@ def html_keep_url(text): """ Transform the url into clickable link with <a/> tag """ idx = 0 final = '' - link_tags = re.compile(r"""(?<!["'])((ftp|http|https):\/\/(\w+:{0,1}\w*@)?([^\s<"':]+)(:[0-9]+)?(\/|\/([^\s<"']))?)(?![^\s<"']*["']|[^\s<"']*</a>)""") + link_tags = re.compile(r"""(?<!["'])((ftp|http|https):\/\/(\w+:{0,1}\w*@)?([^\s<"']+)(:[0-9]+)?(\/|\/([^\s<"']))?)(?![^\s<"']*["']|[^\s<"']*</a>)""") for item in re.finditer(link_tags, text): final += text[idx:item.start()] final += '<a href="%s" target="_blank">%s</a>' % (item.group(0), item.group(0)) |
