schem list validation

This commit is contained in:
Jesse Boyd 2018-10-17 23:57:13 +11:00
parent be9f606027
commit e26cdc6112
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
1 changed files with 5 additions and 0 deletions

View File

@ -613,6 +613,11 @@ public class SchematicCommands extends MethodCommands {
color = "&a";
if (name.indexOf('.') != -1) name = name.substring(0, name.lastIndexOf('.'));
}
try {
if (!MainUtil.isInSubDirectory(dir, file)) {
throw new RuntimeException(new CommandException("Invalid path"));
}
} catch (IOException ignore) {}
} else if (uriStr.startsWith("http://") || uriStr.startsWith("https://")) {
// url
color = "&9";