From 786ebe831f1ccbc5df852b28f4189e3a34f816a2 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Wed, 4 Jul 2018 01:27:01 -0400 Subject: [PATCH] Sanitize Bukkit Command Label Before Passing On (#149) Fixes #146 This might not be the 100% perfect method for fixing this, but as it stands, it's the least amount of diff needed to fix said issue. --- CONTRIBUTORS.md | 1 + bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java | 1 + 2 files changed, 2 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8da4b5ab..60e1f44b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,3 +10,4 @@ If you open a PR and are not already in this file, please feel free to add yours * [***kashike***](https://github.com/aikar/commands/commits?author=kashike) - Sponge Support, Random nit picks * [***Williambraecky***](https://github.com/aikar/commands/commits?author=Williambraecky) - BungeeCord Support * [***dumptruckman***](https://github.com/aikar/commands/commits?author=dumptruckman) - JDA Support +* [***willies952002***](https://github.com/aikar/commands/commits?author=willies952002) diff --git a/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java b/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java index db658455..bef40a29 100644 --- a/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java +++ b/bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java @@ -60,6 +60,7 @@ public class BukkitRootCommand extends Command implements RootCommand { @Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { + if (commandLabel.contains(":")) commandLabel = ACFPatterns.COLON.split(commandLabel, 2)[1]; execute(manager.getCommandIssuer(sender), commandLabel, args); return true; }