summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-01-16 19:42:37 +0000
committerKHobbits <rob@khobbits.co.uk>2012-01-16 19:42:37 +0000
commit1d5a09a03e4226256c1a7691e786f22442117e92 (patch)
tree1ed362173af9bc11e615c64df770a158a9fa9ab6
parent4435121c840aac5de4ac69b3463515f5cde060da (diff)
parent813e66b4f2f2759065f98c5f472bad9a0e0bf2db (diff)
downloadEssentials-1d5a09a03e4226256c1a7691e786f22442117e92.tar
Essentials-1d5a09a03e4226256c1a7691e786f22442117e92.tar.gz
Essentials-1d5a09a03e4226256c1a7691e786f22442117e92.tar.lz
Essentials-1d5a09a03e4226256c1a7691e786f22442117e92.tar.xz
Essentials-1d5a09a03e4226256c1a7691e786f22442117e92.zip
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandnick.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
index 95ad5ea84..b9fbccb37 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -65,9 +66,10 @@ public class Commandnick extends EssentialsCommand
{
if (user == null || user.isAuthorized("essentials.nick.color"))
{
- return nick.replace('&', '\u00a7').replace("\u00a7\u00a7", "&");
+ return nick.replace('&', '\u00a7').replaceAll("\u00a7+k", "");
+ } else {
+ return Util.stripColor(nick);
}
- return nick;
}
private void resetAllNicknames(final Server server)
@@ -86,7 +88,7 @@ public class Commandnick extends EssentialsCommand
private void setNickname(final Server server, final User target, final String nick) throws Exception
{
- if (nick.matches("[^a-zA-Z_0-9]"))
+ if (!nick.matches("^[a-zA-Z_0-9\u00a7]+$"))
{
throw new Exception(_("nickNamesAlpha"));
}