mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +00:00
Fixes sending newlines on messages to impersonate chat messages
This commit is contained in:
parent
7201372b0d
commit
5ad4f44dce
@ -2357,8 +2357,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->craftingType = 0;
|
||||
if($packet->type === TextPacket::TYPE_CHAT){
|
||||
$packet->message = TextFormat::clean($packet->message, $this->removeFormat);
|
||||
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
|
||||
$message = $packet->message;
|
||||
foreach(explode("\n", $packet->message) as $message){
|
||||
if(trim($message) != "" and strlen($message) <= 255){
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerCommandPreprocessEvent($this, $message));
|
||||
if($ev->isCancelled()){
|
||||
break;
|
||||
@ -2375,6 +2375,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ProtocolInfo::CONTAINER_CLOSE_PACKET:
|
||||
if($this->spawned === false or $packet->windowid === 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user