mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-27 20:59:16 +01:00
Double-space (or more) after command alias is no longer accepted, i.e. "f home". Otherwise, command prevention routines (in Factions itself and in other plugins) can be bypassed. For example, preventing the "f home" command wouldn't prevent anyone from using "f home" or "f home" instead.
This commit is contained in:
parent
8333354926
commit
d77cf1fa18
@ -199,6 +199,9 @@ public abstract class MPlugin extends JavaPlugin
|
||||
|
||||
for (String alias : command.aliases)
|
||||
{
|
||||
// disallow double-space after alias, so specific commands can be prevented (preventing "f home" won't prevent "f home")
|
||||
if (commandString.startsWith(alias+" ")) return false;
|
||||
|
||||
if (commandString.startsWith(alias+" ") || commandString.equals(alias))
|
||||
{
|
||||
List<String> args = new ArrayList<String>(Arrays.asList(commandString.split("\\s+")));
|
||||
|
Loading…
Reference in New Issue
Block a user