From 42fc18dfc0207332a6b53551ea4d40dc392f14bd Mon Sep 17 00:00:00 2001 From: "Daniil Zao." Date: Mon, 16 Sep 2024 01:15:20 +0300 Subject: [PATCH] Add a simple invalid region name check Resolves #7 --- src/wgextender/features/claimcommand/WGClaimCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wgextender/features/claimcommand/WGClaimCommand.java b/src/wgextender/features/claimcommand/WGClaimCommand.java index 4949e84..caec10b 100644 --- a/src/wgextender/features/claimcommand/WGClaimCommand.java +++ b/src/wgextender/features/claimcommand/WGClaimCommand.java @@ -30,7 +30,7 @@ protected static void claim(String id, CommandSender sender) throws CommandExcep if (id.equalsIgnoreCase("__global__")) { throw new CommandException("Нельзя заприватить __global__."); } - if (!ProtectedRegion.isValidId(id)) { + if (!ProtectedRegion.isValidId(id) || id.startsWith("-")) { throw new CommandException("Имя региона '" + id + "' содержит запрещённые символы."); }