Limit file name length

pull/160/head
M66B 5 years ago
parent 954c8db225
commit 2c4c91f7cf

@ -528,7 +528,14 @@ public class Helper {
static String sanitizeFilename(String name) { static String sanitizeFilename(String name) {
if (name == null) if (name == null)
return 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) { static String getExtension(String filename) {

Loading…
Cancel
Save