1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 07:18:57 +01:00
This commit is contained in:
Daniil Gentili 2024-02-27 10:34:57 +01:00
parent 3145b87007
commit b9b00b11b3

View File

@ -214,13 +214,15 @@ final class Builder
if ($l === 254) {
$long_len = unpack("V", stream_get_contents($stream, 3).\chr(0))[1];
$x = stream_get_contents($stream, $long_len);
$resto = Tools::posmod(-$long_len, 4);
$resto = (-$long_len) % 4;
$resto = $resto < 0 ? $resto + 4 : $resto;
if ($resto > 0) {
stream_get_contents($stream, $resto);
}
} else {
$x = $l ? stream_get_contents($stream, $l) : "";
$resto = Tools::posmod(-($l + 1), 4);
$resto = (-$l+1) % 4;
$resto = $resto < 0 ? $resto + 4 : $resto;
if ($resto > 0) {
stream_get_contents($stream, $resto);
}