added a safe-filename function so we will be sure the suggested filename won't break anything in the operating system

This commit is contained in:
2019-10-14 17:25:06 -05:00
parent 9e6e72c0a1
commit 0cdfc253d2
3 changed files with 7 additions and 3 deletions

View File

@@ -594,7 +594,7 @@ class documentBuffer(feedBuffer):
def download(self, *args, **kwargs):
post = self.get_post()
filename = post["title"]
filename = utils.safe_filename(post["title"])
# If document does not end in .extension we must fix it so the file dialog will save it properly later.
if filename.endswith(post["ext"]) == False:
filename = filename+ "."+post["ext"]