From b4e60b7db54bf7e1d05c20cfabd25b14ccbfad3c Mon Sep 17 00:00:00 2001 From: Julian Date: Thu, 30 Mar 2023 12:47:23 +0200 Subject: [PATCH] Prevent loading of extensions outside of the expansions folder using the register command --- .../commands/impl/local/CommandExpansionRegister.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java index c6085b6..260f03d 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java @@ -54,7 +54,7 @@ public final class CommandExpansionRegister extends PlaceholderCommand { final LocalExpansionManager manager = plugin.getLocalExpansionManager(); final File file = new File(manager.getExpansionsFolder(), params.get(0)); - if (!file.exists()) { + if (!file.exists() || !file.getParentFile().equals(manager.getExpansionsFolder())) { Msg.msg(sender, "&cThe file &f" + file.getName() + "&c doesn't exist!"); return;