Verify player name command input, closes #2729, closes #2749

This commit is contained in:
Jack Noordhuis
2019-02-11 03:24:38 +11:00
committed by Dylan K. Taylor
parent 243c12de7c
commit 27767e7ddb
3 changed files with 10 additions and 0 deletions

View File

@@ -53,6 +53,9 @@ class OpCommand extends VanillaCommand{
}
$name = array_shift($args);
if(!Player::isValidUserName($name)){
throw new InvalidCommandSyntaxException();
}
$player = $sender->getServer()->getOfflinePlayer($name);
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$player->getName()]));