validate names when trusting players

This commit is contained in:
Len 2022-06-19 11:58:53 +02:00
parent 9fe7f8258d
commit 56ad239cbc

View File

@ -2589,6 +2589,10 @@ public class GriefPrevention extends JavaPlugin
String permission = null;
OfflinePlayer otherPlayer = null;
UUID recipientID = null;
if (!recipientName.matches("^\\w{3,16}$")) {
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerNotFound2);
return;
}
if (recipientName.startsWith("[") && recipientName.endsWith("]"))
{
permission = recipientName.substring(1, recipientName.length() - 1);