mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:56:05 -04:00
Enforce ascii filenames for uploads
This commit is contained in:
parent
2124f668db
commit
9beaedd164
3 changed files with 15 additions and 1 deletions
|
@ -33,3 +33,12 @@ def random_string_with_symbols(length):
|
|||
return ''.join(
|
||||
random.choice(_string_with_symbols) for _ in xrange(length)
|
||||
)
|
||||
|
||||
|
||||
def is_ascii(s):
|
||||
try:
|
||||
s.encode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue