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;
|
$this->craftingType = 0;
|
||||||
if($packet->type === TextPacket::TYPE_CHAT){
|
if($packet->type === TextPacket::TYPE_CHAT){
|
||||||
$packet->message = TextFormat::clean($packet->message, $this->removeFormat);
|
$packet->message = TextFormat::clean($packet->message, $this->removeFormat);
|
||||||
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
|
foreach(explode("\n", $packet->message) as $message){
|
||||||
$message = $packet->message;
|
if(trim($message) != "" and strlen($message) <= 255){
|
||||||
$this->server->getPluginManager()->callEvent($ev = new PlayerCommandPreprocessEvent($this, $message));
|
$this->server->getPluginManager()->callEvent($ev = new PlayerCommandPreprocessEvent($this, $message));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
break;
|
break;
|
||||||
@ -2375,6 +2375,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::CONTAINER_CLOSE_PACKET:
|
case ProtocolInfo::CONTAINER_CLOSE_PACKET:
|
||||||
if($this->spawned === false or $packet->windowid === 0){
|
if($this->spawned === false or $packet->windowid === 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user