From b3f5ab671014356add2978fe0d2c7e4ba535020c Mon Sep 17 00:00:00 2001 From: A complex spell made by a pony Date: Mon, 9 Oct 2017 00:28:21 +0300 Subject: [PATCH] Secret chat bugfix --- src/danog/MadelineProto/SecretChats/AuthKeyHandler.php | 2 +- src/danog/MadelineProto/Serialization.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/SecretChats/AuthKeyHandler.php b/src/danog/MadelineProto/SecretChats/AuthKeyHandler.php index f7cf413f..3f4addf7 100644 --- a/src/danog/MadelineProto/SecretChats/AuthKeyHandler.php +++ b/src/danog/MadelineProto/SecretChats/AuthKeyHandler.php @@ -198,7 +198,7 @@ trait AuthKeyHandler public function complete_rekey($chat, $params) { - if ($this->secret_chats[$chat]['rekeying'][0] !== 2) { + if ($this->secret_chats[$chat]['rekeying'][0] !== 2 || !isset($this->temp_rekeyed_secret_chats['fingerprint'])) { return; } if ($this->temp_rekeyed_secret_chats['fingerprint'] !== $params['key_fingerprint']) { diff --git a/src/danog/MadelineProto/Serialization.php b/src/danog/MadelineProto/Serialization.php index 7a968a5b..51c13652 100644 --- a/src/danog/MadelineProto/Serialization.php +++ b/src/danog/MadelineProto/Serialization.php @@ -85,7 +85,7 @@ class Serialization if (Logger::$constructed) { Logger::log([(string) $e], Logger::ERROR); } - if ($e->getMessage() === "Erroneous data format for unserializing 'phpseclib\Math\BigInteger'") { + if (strpos($e->getMessage(), "Erroneous data format for unserializing 'phpseclib\Math\BigInteger'") === 0) { $tounserialize = str_replace('phpseclib\Math\BigInteger', 'phpseclib\Math\BigIntegor', $unserialized); } $unserialized = \danog\Serialization::unserialize($tounserialize);