加入中文文件名支持
This commit is contained in:
parent
4302b9fd31
commit
e3452e6a3c
@ -17,7 +17,7 @@ class FileService:
|
|||||||
if len(filename) > 200 or len(filename) < 1:
|
if len(filename) > 200 or len(filename) < 1:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
illegal_chars = r'[^a-zA-Z0-9_.-]'
|
illegal_chars = r'[^a-zA-Z0-9_.\-\u4e00-\u9fff\u3400-\u4dbf\uf900-\ufaff]'
|
||||||
if (
|
if (
|
||||||
re.search(illegal_chars, filename)
|
re.search(illegal_chars, filename)
|
||||||
or filename.startswith("_")
|
or filename.startswith("_")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user