mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
fix crash when var_dumping packets
This commit is contained in:
@@ -107,7 +107,7 @@ abstract class DataPacket extends BinaryStream{
|
|||||||
public function __debugInfo(){
|
public function __debugInfo(){
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach($this as $k => $v){
|
foreach($this as $k => $v){
|
||||||
if($k === "buffer"){
|
if($k === "buffer" and is_string($v)){
|
||||||
$data[$k] = bin2hex($v);
|
$data[$k] = bin2hex($v);
|
||||||
}elseif(is_string($v) or (is_object($v) and method_exists($v, "__toString"))){
|
}elseif(is_string($v) or (is_object($v) and method_exists($v, "__toString"))){
|
||||||
$data[$k] = Utils::printable((string) $v);
|
$data[$k] = Utils::printable((string) $v);
|
||||||
|
Reference in New Issue
Block a user