From a1802f7382ca71e658b2165361bdeb181391e1f6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 6 Feb 2014 14:11:12 +0530 Subject: [PATCH 1/2] Scrub (encode) url of print html --- core/doctype/communication/communication.py | 2 ++ webnotes/utils/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index 1544f28c8a..20e44b3930 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import webnotes +from webnotes.utils import scrub_urls class DocType(): def __init__(self, doc, doclist=[]): @@ -108,6 +109,7 @@ def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', s mail.cc.append(webnotes.conn.get_value("Profile", webnotes.session.user, "email")) if print_html: + print_html = scrub_urls(print_html) mail.add_attachment(name.replace(' ','').replace('/','-') + '.html', print_html) for a in loads(attachments): diff --git a/webnotes/utils/__init__.py b/webnotes/utils/__init__.py index 2df91cd98d..6f30274107 100644 --- a/webnotes/utils/__init__.py +++ b/webnotes/utils/__init__.py @@ -933,7 +933,7 @@ def expand_relative_urls(html): def quote_urls(html): def _quote_url(match): groups = list(match.groups()) - groups[2] = urllib.quote(groups[2], safe="/:") + groups[2] = urllib.quote(groups[2], safe="~@#$&()*!+=:;,.?/'") return "".join(groups) return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)', _quote_url, html) From ce5f9bd158831e749630b63c9cc0bfdaec30c299 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 6 Feb 2014 15:56:54 +0600 Subject: [PATCH 2/2] bumped to version 3.9.2 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 6f1cc2abf6..4342dc3cf4 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.9.1", + "framework_version": "3.9.2", "modules": { "Calendar": { "color": "#2980b9",