From a2f730a77cf19ce357d0d8f3ed2b3381e666ef6a Mon Sep 17 00:00:00 2001 From: Pepich Date: Mon, 6 Feb 2017 22:52:38 +0100 Subject: [PATCH] Denied regex wildcard (.*) as an alias key --- src/com/redstoner/modules/chatalias/Chatalias.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/redstoner/modules/chatalias/Chatalias.java b/src/com/redstoner/modules/chatalias/Chatalias.java index c0eca57..ae851f5 100644 --- a/src/com/redstoner/modules/chatalias/Chatalias.java +++ b/src/com/redstoner/modules/chatalias/Chatalias.java @@ -26,7 +26,7 @@ import com.redstoner.misc.Utils; import com.redstoner.modules.Module; @AutoRegisterListener -@Version(major = 1, minor = 0, revision = 0, compatible = 1) +@Version(major = 1, minor = 0, revision = 1, compatible = 1) public class Chatalias implements Module, Listener { // to export chatalias data to json: @@ -180,6 +180,11 @@ public class Chatalias implements Module, Listener @Command(hook = "addalias") public boolean addAlias(CommandSender sender, boolean regex, String keyword, String replacement) { + if (keyword.equals(".*")) + { + Utils.sendErrorMessage(sender, null, "You may not define the wildcard regex as an alias."); + return true; + } Player player = (Player) sender; UUID uuid = player.getUniqueId(); JSONObject data = (JSONObject) aliases.get(uuid.toString());