mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Limit file name length
This commit is contained in:
parent
954c8db225
commit
2c4c91f7cf
1 changed files with 8 additions and 1 deletions
|
@ -528,7 +528,14 @@ public class Helper {
|
|||
static String sanitizeFilename(String name) {
|
||||
if (name == null)
|
||||
return null;
|
||||
return name.replaceAll("[?:\"*|/\\\\<>]", "_");
|
||||
|
||||
name = name.replaceAll("[?:\"*|/\\\\<>]", "_");
|
||||
|
||||
// Both the name and extension can be long
|
||||
if (name.length() > 255)
|
||||
name = name.substring(0, 255);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
static String getExtension(String filename) {
|
||||
|
|
Loading…
Reference in a new issue