From 8714b5090f110f2999c3c68b045dbf47a05539dd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 5 Feb 2014 13:39:00 +0530 Subject: [PATCH 1/9] Encode URI component in link field formatter --- public/js/wn/form/formatters.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/wn/form/formatters.js b/public/js/wn/form/formatters.js index 398065afd2..1f75eef90c 100644 --- a/public/js/wn/form/formatters.js +++ b/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) ? "" : (' ') }); From c959f6e061a3ee5e3c1f47e179fbfd5bc25e2531 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 5 Feb 2014 19:18:26 +0600 Subject: [PATCH 2/9] bumped to version 3.9.1 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 51d656b777..6f1cc2abf6 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.1", "modules": { "Calendar": { "color": "#2980b9", From a1802f7382ca71e658b2165361bdeb181391e1f6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 6 Feb 2014 14:11:12 +0530 Subject: [PATCH 3/9] 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 4/9] 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", From c7d6a5553e1889f8d410e67078f1e84e8cba3716 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 7 Feb 2014 15:53:31 +0530 Subject: [PATCH 5/9] Minor fix in nestedset --- webnotes/utils/nestedset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webnotes/utils/nestedset.py b/webnotes/utils/nestedset.py index be82fff496..662f4cf077 100644 --- a/webnotes/utils/nestedset.py +++ b/webnotes/utils/nestedset.py @@ -189,7 +189,7 @@ class DocTypeNestedSet(object): self.doc.fields[self.nsm_parent_field] = "" update_nsm(self) - def before_rename(self, newdn, olddn, merge=False, group_fname="is_group"): + def before_rename(self, olddn, newdn, merge=False, group_fname="is_group"): if merge: is_group = webnotes.conn.get_value(self.doc.doctype, newdn, group_fname) if self.doc.fields[group_fname] != is_group: From 4da315c4976bdf4da17036d16c9cb45c8831270a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 7 Feb 2014 15:54:06 +0530 Subject: [PATCH 6/9] Set subject while pulling email if subject not specified --- webnotes/utils/email_lib/receive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webnotes/utils/email_lib/receive.py b/webnotes/utils/email_lib/receive.py index 57991bfbb5..3f0559630c 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: From bd515c8a7dd872b75b680a49c8305df33c4c95a4 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Fri, 7 Feb 2014 16:33:00 +0600 Subject: [PATCH 7/9] bumped to version 3.9.3 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 4342dc3cf4..5a17aad35f 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.9.2", + "framework_version": "3.9.3", "modules": { "Calendar": { "color": "#2980b9", From c754a4fbddbf75cca7efc110ebaec38bae0dd0cd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 9 Feb 2014 18:30:09 +0530 Subject: [PATCH 8/9] trim for checking text editor content --- public/js/wn/ui/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/wn/ui/editor.js b/public/js/wn/ui/editor.js index e2574f125b..43443b0e17 100644 --- a/public/js/wn/ui/editor.js +++ b/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!) From e562c81aa8702471cc4741a6dd62a471273db7ad Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Mon, 10 Feb 2014 21:27:16 +0600 Subject: [PATCH 9/9] bumped to version 3.9.4 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 5a17aad35f..8a551ee2ed 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.9.3", + "framework_version": "3.9.4", "modules": { "Calendar": { "color": "#2980b9",