Remove NUL characters from file names

This commit is contained in:
M66B 2020-10-29 11:50:06 +01:00
parent 70b868cc41
commit 43d7dc2c8e
1 changed files with 4 additions and 1 deletions

View File

@ -1012,7 +1012,10 @@ public class Helper {
if (name == null)
return null;
return name.replaceAll("[?:\"*|/\\\\<>]", "_");
return name
// Canonical files names cannot contain NUL
.replace("\0", "")
.replaceAll("[?:\"*|/\\\\<>]", "_");
}
static String getExtension(String filename) {