Skip to content

Commit

Permalink
Add a simple invalid region name check
Browse files Browse the repository at this point in the history
Resolves #7
  • Loading branch information
imDaniX committed Sep 15, 2024
1 parent 1506e56 commit 42fc18d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wgextender/features/claimcommand/WGClaimCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "' содержит запрещённые символы.");
}

Expand Down

0 comments on commit 42fc18d

Please sign in to comment.