schem list validation

This commit is contained in:
Jesse Boyd 2018-10-17 23:57:36 +11:00
parent f65887c957
commit a7c6d5e987
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -603,6 +603,11 @@ public class SchematicCommands extends MethodCommands {
if (uriStr.startsWith("file:/")) { if (uriStr.startsWith("file:/")) {
File file = new File(uri.getPath()); File file = new File(uri.getPath());
name = file.getName(); name = file.getName();
try {
if (!MainUtil.isInSubDirectory(dir, file)) {
throw new RuntimeException(new CommandException("Invalid path"));
}
} catch (IOException ignore) {}
if (file.isDirectory()) { if (file.isDirectory()) {
isDir = true; isDir = true;
color = "&6"; color = "&6";