diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-05-19 17:41:52 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-05-19 17:44:47 +0100 |
commit | bc798977b5db9d42800aadbd0a062c019866d8da (patch) | |
tree | cba9df49859247769e39d950e51bd00b3186f930 | |
parent | fee3d7c0d362443a6bbfe83773df740caed2c49d (diff) | |
download | Essentials-bc798977b5db9d42800aadbd0a062c019866d8da.tar Essentials-bc798977b5db9d42800aadbd0a062c019866d8da.tar.gz Essentials-bc798977b5db9d42800aadbd0a062c019866d8da.tar.lz Essentials-bc798977b5db9d42800aadbd0a062c019866d8da.tar.xz Essentials-bc798977b5db9d42800aadbd0a062c019866d8da.zip |
Strip invalid chars from kit names
This may possibly block some kits from working that previous worked, if the kit name contained unusual letters
3 files changed, 5 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 5686e0439..c994eeed5 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -594,7 +594,7 @@ public abstract class UserData extends PlayerExtension implements IConf public void setBanReason(String reason) { - config.setProperty("ban.reason", reason); + config.setProperty("ban.reason", Util.sanitizeString(reason)); config.save(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 514a5acca..a545adf60 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -25,12 +25,12 @@ public class Commandkit extends EssentialsCommand else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) { final User userTo = getPlayer(server, args, 1, true); - final String kitName = args[0].toLowerCase(Locale.ENGLISH); + final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(userTo, user, kitName); } else { - final String kitName = args[0].toLowerCase(Locale.ENGLISH); + final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(user, user, kitName); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java index 8ed298303..877da4d26 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.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 org.bukkit.Server; @@ -20,7 +21,7 @@ public class Commandsetjail extends EssentialsCommand throw new NotEnoughArgumentsException(); } ess.getJails().setJail(args[0], user.getLocation()); - user.sendMessage(_("jailSet", args[0])); + user.sendMessage(_("jailSet", Util.sanitizeString(args[0]))); } } |