Fix path separator in replay name

Would probably have been caught by the write check as well, except in the
specific case where the folder exists, e.g. `../`
This commit is contained in:
Jonas Herzig
2022-04-10 13:49:32 +02:00
parent d6c6220bdd
commit fb38a20465

View File

@@ -186,6 +186,10 @@ public class Utils {
* Checks whether a given file name is actually usable with the file system / operating system at the given folder.
*/
private static boolean isUsable(Path folder, String fileName) {
if (fileName.contains(folder.getFileSystem().getSeparator())) {
return false; // file name contains the name separator, definitely not usable
}
Path path;
try {
path = folder.resolve(fileName);