diff --git a/frappe/__version__.py b/frappe/__version__.py index 29c39694fb..3a520d65e8 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = "4.13.5" +__version__ = "4.13.6" diff --git a/frappe/hooks.py b/frappe/hooks.py index 8b6fafd18e..9c74b8cf7c 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -4,7 +4,7 @@ app_title = "Frappe Framework" app_publisher = "Web Notes Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "assets/frappe/images/frappe.svg" -app_version = "4.13.5" +app_version = "4.13.6" app_color = "#3498db" app_email = "support@frappe.io" diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index 7987f4614c..09becd9f9d 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -63,8 +63,13 @@ def extract_email_id(email): def validate_email_add(email_str): """Validates the email string""" + if email_str and " " in email_str and "<" not in email_str: + # example: "test@example.com test2@example.com" will return "test@example.comtest2" after parseaddr!!! + return False + email = extract_email_id(email_str) match = re.match("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", email.lower()) + if not match: return False diff --git a/frappe/utils/file_manager.py b/frappe/utils/file_manager.py index e6a61789ed..b3194ecf7c 100644 --- a/frappe/utils/file_manager.py +++ b/frappe/utils/file_manager.py @@ -228,10 +228,14 @@ def delete_file_data_content(doc): def delete_file_from_filesystem(doc): path = doc.file_name + if path.startswith("files/"): path = frappe.utils.get_site_path("public", doc.file_name) else: path = frappe.utils.get_site_path("public", "files", doc.file_name) + + path = encode(path) + if os.path.exists(path): os.remove(path) diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index d1388634b4..57c83fefdb 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -96,16 +96,15 @@ class WebsiteGenerator(Document): if old_route and old_route != self.get_route(): # clear cache of old routes - old_routes = frappe.get_all(self.doctype, fields=["parent_website_route", "page_name"], - filters={"parent_website_route": ("like", old_route + "%")}) + old_routes = frappe.get_all(self.doctype, filters={"parent_website_route": ("like", old_route + "%")}) if old_routes: - for old_route in old_routes: - clear_cache(make_route(old_route)) + for like_old_route in old_routes: + clear_cache(frappe.get_doc(self.doctype, like_old_route.name).get_route()) frappe.db.sql("""update `tab{0}` set parent_website_route = replace(parent_website_route, %s, %s), - modified = %s + modified = %s, modified_by = %s where parent_website_route like %s""".format(self.doctype), (old_route, self.get_route(), now(), frappe.session.user, old_route + "%")) diff --git a/requirements.txt b/requirements.txt index 1a431ed337..89ce2dd125 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ markupsafe mysql-python==1.2.5 pygeoip python-dateutil -python-memcached +python-memcached==1.53 pytz six slugify diff --git a/setup.py b/setup.py index 166e103f80..9340dfe961 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "4.13.5" +version = "4.13.6" with open("requirements.txt", "r") as f: install_requires = f.readlines()