Secret chat bugfix

This commit is contained in:
A complex spell made by a pony 2017-10-09 00:28:21 +03:00
parent c4ca3a8d74
commit b3f5ab6710
2 changed files with 2 additions and 2 deletions

View File

@ -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']) {

View File

@ -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);