From c5135942ce6ec351a22a74d2ffb0b68648412329 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 9 Jul 2017 10:08:21 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/danog/MadelineProto/Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index d8ecb3c0..00dc3081 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -250,7 +250,9 @@ var_dump(is_null($this->{$name})); { if ($length !== null) { $what = substr($what, 0, $length); - } else $length = strlen($what); + } else { + $length = strlen($what); + } switch ($this->protocol) { case 'obfuscated2': @@ -344,6 +346,7 @@ var_dump(is_null($this->{$name})); case 'obfuscated2': case 'tcp_abridged': $packet_length = ord($this->read(1)); + return $this->read($packet_length < 127 ? $packet_length << 2 : unpack('V', $this->read(3)."\0")[1] << 2); case 'http':