From a6691631963fe2ad13ec8fb3d163d73af84f1303 Mon Sep 17 00:00:00 2001 From: drtshock Date: Sat, 2 Jan 2016 12:17:43 -0800 Subject: [PATCH] Remove colour in permission checks. As @supaham pointed out, this can cause issues with giving a player a wildcard permission and then negating the specific node if both nodes aren't negated. --- .../src/com/earth2me/essentials/commands/Commandnick.java | 2 +- Essentials/src/com/earth2me/essentials/utils/FormatUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index a9f17df09..96ada76b0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -79,7 +79,7 @@ public class Commandnick extends EssentialsLoopCommand { throw new Exception(tl("nickTooLong")); } else if (FormatUtil.stripFormat(newNick).length() < 1) { throw new Exception(tl("nickNamesAlpha")); - } else if (user != null && (user.isAuthorized("essentials.nick.changecolors") || user.isAuthorized("essentials.nick.changecolours")) && !FormatUtil.stripFormat(newNick).equals(user.getName())) { + } else if (user != null && (user.isAuthorized("essentials.nick.changecolors")) && !FormatUtil.stripFormat(newNick).equals(user.getName())) { throw new Exception(tl("nickNamesOnlyColorChanges")); } return newNick; diff --git a/Essentials/src/com/earth2me/essentials/utils/FormatUtil.java b/Essentials/src/com/earth2me/essentials/utils/FormatUtil.java index 001a1daec..7de0a4726 100644 --- a/Essentials/src/com/earth2me/essentials/utils/FormatUtil.java +++ b/Essentials/src/com/earth2me/essentials/utils/FormatUtil.java @@ -68,7 +68,7 @@ public class FormatUtil { return null; } String message; - if (user.isAuthorized(permBase + ".color") || user.isAuthorized(permBase + ".colour")) { + if (user.isAuthorized(permBase + ".color")) { message = replaceColor(input, REPLACE_COLOR_PATTERN); } else { message = stripColor(input, VANILLA_COLOR_PATTERN);