From 0689c16309a8a404f920f5e5543b64ad8a3309b2 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Tue, 8 Aug 2023 18:47:22 +0200 Subject: [PATCH] Hotfix: bytes to string --- src/MTProtoTools/Files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MTProtoTools/Files.php b/src/MTProtoTools/Files.php index 21f27228e..531c31840 100644 --- a/src/MTProtoTools/Files.php +++ b/src/MTProtoTools/Files.php @@ -1103,8 +1103,8 @@ trait Files return 0; } if (isset($messageMedia['cdn_key'])) { - $ivec = \substr($messageMedia['cdn_iv'], 0, 12).\pack('N', $offset['offset'] >> 4); - $res['bytes'] = Crypt::ctrEncrypt($res['bytes'], $messageMedia['cdn_key'], $ivec); + $ivec = \substr((string)$messageMedia['cdn_iv'], 0, 12).\pack('N', $offset['offset'] >> 4); + $res['bytes'] = Crypt::ctrEncrypt($res['bytes'], (string)$messageMedia['cdn_key'], $ivec); $this->checkCdnHash($messageMedia['file_token'], $offset['offset'], $res['bytes'], $old_dc); } if (isset($messageMedia['key'])) {