1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 04:35:12 +01:00

Small bugfix and improvement for layer diffing script

This commit is contained in:
Daniil Gentili 2019-07-07 19:37:54 +02:00
parent 26d13c6e5c
commit 1efbe6a337
2 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,7 @@ foreach (['methods', 'constructors'] as $type) {
foreach ($new[$type]->by_id as $constructor) {
$name = $constructor[$key];
$constructor['id'] = $new[$type]->$finder($name)['id'];
if ($old[$type]->$finder($name) && $old[$type]->$finder($name)['id'] !== $constructor['id']) {
if ($old[$type]->$finder($name)) {
$new_args = $constructor['params'];
$old_args = $old[$type]->$finder($name)['params'];
$final_new_args = [];

View File

@ -122,6 +122,9 @@ trait Tools
public static function unpack_signed_long_string($value)
{
if (is_int($value)) {
return (string) $value;
}
if (strlen($value) !== 8) {
throw new TL\Exception(\danog\MadelineProto\Lang::$current_lang['length_not_8']);
}