diff --git a/config.json b/config.json index 51d656b777..8a551ee2ed 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.9.0", + "framework_version": "3.9.4", "modules": { "Calendar": { "color": "#2980b9", diff --git a/webnotes/core/doctype/communication/communication.py b/webnotes/core/doctype/communication/communication.py index 8dce5ee0ee..80a6c20207 100644 --- a/webnotes/core/doctype/communication/communication.py +++ b/webnotes/core/doctype/communication/communication.py @@ -10,6 +10,7 @@ from webnotes.webutils import is_signup_enabled from webnotes.utils import get_url, cstr from webnotes.utils.email_lib.email_body import get_email from webnotes.utils.email_lib.smtp import send +from webnotes.utils import scrub_urls class DocType(): def __init__(self, doc, doclist=None): @@ -128,6 +129,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 json.loads(attachments): diff --git a/webnotes/public/js/wn/form/formatters.js b/webnotes/public/js/wn/form/formatters.js index 398065afd2..1f75eef90c 100644 --- a/webnotes/public/js/wn/form/formatters.js +++ b/webnotes/public/js/wn/form/formatters.js @@ -35,9 +35,10 @@ wn.form.formatters = { if(!value) return ""; if(docfield && docfield.options) { - return repl('%(icon)s%(name)s', { - doctype: docfield.options, - name: value, + return repl('%(icon)s%(label)s', { + doctype: encodeURIComponent(docfield.options), + name: encodeURIComponent(value), + label: value, icon: (options && options.no_icon) ? "" : (' ') }); diff --git a/webnotes/public/js/wn/ui/editor.js b/webnotes/public/js/wn/ui/editor.js index e2574f125b..43443b0e17 100644 --- a/webnotes/public/js/wn/ui/editor.js +++ b/webnotes/public/js/wn/ui/editor.js @@ -125,7 +125,7 @@ bsEditor = Class.extend({ clean_html: function() { var html = this.editor.html() || ""; - if(!strip(this.editor.text()) && !(this.editor.find("img"))) html = ""; + if(!$.trim(this.editor.text()) && !(this.editor.find("img"))) html = ""; // html = html.replace(/(
|\s|

<\/div>| )*$/, ''); // remove custom typography (use CSS!) diff --git a/webnotes/utils/__init__.py b/webnotes/utils/__init__.py index b838bceb62..9b4ad265c8 100644 --- a/webnotes/utils/__init__.py +++ b/webnotes/utils/__init__.py @@ -910,7 +910,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) diff --git a/webnotes/utils/email_lib/receive.py b/webnotes/utils/email_lib/receive.py index 60d765be63..c492650c93 100644 --- a/webnotes/utils/email_lib/receive.py +++ b/webnotes/utils/email_lib/receive.py @@ -52,7 +52,10 @@ class IncomingMail: else: # assume that the encoding is utf-8 self.subject = self.subject.decode("utf-8") - + + if not self.subject: + self.subject = "No Subject" + def set_content_and_type(self): self.content, self.content_type = '[Blank Email]', 'text/plain' if self.text_content: