summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-27 10:50:49 +0100
committerErik Johnston <erik@matrix.org>2015-08-27 10:50:49 +0100
commitddf4d2bd981cbc4079b2bff0a2bba500b1aad208 (patch)
tree5d6c671d215c90782a9d40d8e0c938ed39a67fa3 /synapse
parentCheck for an internationalised filename first (diff)
downloadsynapse-ddf4d2bd981cbc4079b2bff0a2bba500b1aad208.tar.xz
Consistency
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/media/v1/base_resource.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/rest/media/v1/base_resource.py b/synapse/rest/media/v1/base_resource.py
index 03ebbbefe9..b2aeb8c909 100644
--- a/synapse/rest/media/v1/base_resource.py
+++ b/synapse/rest/media/v1/base_resource.py
@@ -155,9 +155,9 @@ class BaseMediaResource(Resource):
 
                 # If there isn't check for an ascii name.
                 if not upload_name:
-                    upload_name = params.get("filename", None)
-                    if upload_name and not is_ascii(upload_name):
-                        upload_name = None
+                    upload_name_ascii = params.get("filename", None)
+                    if upload_name_ascii and is_ascii(upload_name_ascii):
+                        upload_name = upload_name_ascii
 
                 if upload_name:
                     upload_name = urlparse.unquote(upload_name)