Better escaping

This commit is contained in:
Daniil Gentili 2019-12-13 21:31:35 +01:00
parent f63edd9c06
commit 7b2b69e97d
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 5 additions and 7 deletions

View File

@ -14,7 +14,6 @@
"danog/primemodule": "^1", "danog/primemodule": "^1",
"danog/magicalserializer": "^1.0", "danog/magicalserializer": "^1.0",
"phpseclib/phpseclib": "dev-master#f715b2928976aaef389839a056c947aa8023277b as 2.0.15", "phpseclib/phpseclib": "dev-master#f715b2928976aaef389839a056c947aa8023277b as 2.0.15",
"vlucas/phpdotenv": "^3",
"erusev/parsedown": "^1.7", "erusev/parsedown": "^1.7",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-json": "*", "ext-json": "*",
@ -36,6 +35,7 @@
"amphp/uri": "dev-master" "amphp/uri": "dev-master"
}, },
"require-dev": { "require-dev": {
"vlucas/phpdotenv": "^3",
"phpdocumentor/reflection-docblock": "^4.3", "phpdocumentor/reflection-docblock": "^4.3",
"ennexa/amp-update-cache": "dev-master", "ennexa/amp-update-cache": "dev-master",
"phpunit/phpunit": "^8", "phpunit/phpunit": "^8",

View File

@ -108,14 +108,14 @@ class API extends InternalDoc
$tounserialize = \str_replace('O:26:"danog\\MadelineProto\\Button":', 'O:35:"danog\\MadelineProto\\TL\\Types\\Button":', $tounserialize); $tounserialize = \str_replace('O:26:"danog\\MadelineProto\\Button":', 'O:35:"danog\\MadelineProto\\TL\\Types\\Button":', $tounserialize);
$changed = true; $changed = true;
} }
if (\strpos($tounserialize, 'C:25:"phpseclib\Math\BigInteger') !== false) {
$tounserialize = \str_replace('C:25:"phpseclib\Math\BigInteger', 'C:26:"phpseclib3\Math\BigInteger', $tounserialize);
$changed = true;
}
if (\strpos($e->getMessage(), "Erroneous data format for unserializing 'phpseclib\\Math\\BigInteger'") === 0) { if (\strpos($e->getMessage(), "Erroneous data format for unserializing 'phpseclib\\Math\\BigInteger'") === 0) {
$tounserialize = \str_replace('phpseclib\\Math\\BigInteger', 'phpseclib\\Math\\BigIntegor', $tounserialize); $tounserialize = \str_replace('phpseclib\\Math\\BigInteger', 'phpseclib\\Math\\BigIntegor', $tounserialize);
$changed = true; $changed = true;
} }
if (\strpos($tounserialize, 'C:25:"phpseclib\\Math\\BigInteger') !== false) {
$tounserialize = \str_replace('C:25:"phpseclib\\Math\\BigInteger', 'C:26:"phpseclib3\\Math\\BigInteger', $tounserialize);
$changed = true;
}
Logger::log((string) $e, Logger::ERROR); Logger::log((string) $e, Logger::ERROR);
if (!$changed) { if (!$changed) {

View File

@ -20,8 +20,6 @@ namespace danog\MadelineProto\Stream\MTProtoTransport;
use Amp\Promise; use Amp\Promise;
use Amp\Socket\EncryptableSocket; use Amp\Socket\EncryptableSocket;
use danog\MadelineProto\Stream\Async\Buffer;
use danog\MadelineProto\Stream\Async\BufferedStream;
use danog\MadelineProto\Stream\Async\Stream; use danog\MadelineProto\Stream\Async\Stream;
use danog\MadelineProto\Stream\BufferedProxyStreamInterface; use danog\MadelineProto\Stream\BufferedProxyStreamInterface;
use danog\MadelineProto\Stream\Common\CtrStream; use danog\MadelineProto\Stream\Common\CtrStream;