mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-14 20:21:50 +01:00
Strip invalid chars from kit names
This may possibly block some kits from working that previous worked, if the kit name contained unusual letters
This commit is contained in:
parent
fee3d7c0d3
commit
bc798977b5
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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])));
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user