Skip to content

Commit

Permalink
Backported 1.20 updates and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Dec 1, 2023
1 parent f5fe78d commit 7f91e09
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ public static void scanForInvalidFiles(String pathName, Path path) throws IOExce
var fileNameLC = fileName.toLowerCase();

if (fileNameLC.endsWith(".zip") || fileNameLC.equals(".ds_store") || fileNameLC.equals("thumbs.db") || fileNameLC.equals("desktop.ini")) {
return;
continue;
} else if (Files.isHidden(path)) {
ConsoleJS.STARTUP.error("Invisible file found: " + pathName + path.relativize(p).toString().replace('\\', '/'));
return;
continue;
}

var chars = fileName.toCharArray();

for (char c : chars) {
if (c >= 'A' && c <= 'Z') {
ConsoleJS.STARTUP.error("Invalid file name: Uppercase '" + c + "' in " + pathName + path.relativize(p).toString().replace('\\', '/'));
return;
break;
} else if (c != '_' && c != '-' && (c < 'a' || c > 'z') && (c < '0' || c > '9') && c != '/' && c != '.') {
ConsoleJS.STARTUP.error("Invalid file name: Invalid character '" + c + "' in " + pathName + path.relativize(p).toString().replace('\\', '/'));
return;
break;
}
}
} catch (Exception ex) {
Expand Down

0 comments on commit 7f91e09

Please sign in to comment.