Limit filename length to 255 characters

https://github.com/domainaware/parsedmarc/issues/197

Since there is a limit for filename length in some OS, filename length should be limited. I propose limit it to 255 characters.
This commit is contained in:
Arne Allisat
2020-11-06 09:21:17 +01:00
parent 82b1a7e292
commit 06e42791c4
+2
View File
@@ -395,6 +395,8 @@ def get_filename_safe_string(string):
string = string.replace(char, "")
string = string.rstrip(".")
string = (string[:255]) if len(string) > 255 else string
return string