Merge pull request #1877 from d14na/patch-1

Add support for tilde `~` in filenames.
This commit is contained in:
ZeroNet 2019-01-24 15:54:07 +01:00 committed by GitHub
commit 055aea58bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -552,7 +552,7 @@ class ContentManager(object):
elif len(relative_path) > 255: elif len(relative_path) > 255:
return False return False
else: else:
return re.match("^[a-z\[\]\(\) A-Z0-9_@=\.\+-/]+$", relative_path) return re.match("^[a-z\[\]\(\) A-Z0-9~_@=\.\+-/]+$", relative_path)
def sanitizePath(self, inner_path): def sanitizePath(self, inner_path):
return re.sub("[^a-z\[\]\(\) A-Z0-9_@=\.\+-/]", "", inner_path) return re.sub("[^a-z\[\]\(\) A-Z0-9_@=\.\+-/]", "", inner_path)