From 5c104180f091fd78c1f48a78967f64fa7f312209 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 4 Sep 2019 16:50:34 +0000 Subject: [PATCH] php 7.4 fixes --- src/danog/MadelineProto/MTProto.php | 10 +++++----- tests/makephar.sh | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 603bf190..250dd788 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -802,7 +802,7 @@ class MTProto extends AsyncConstruct implements TLCallback $settings['app_info']['api_id'] = $previousSettings['app_info']['api_id']; $settings['app_info']['api_hash'] = $previousSettings['app_info']['api_hash']; } else { - $settings['app_info'] = null; + $settings['app_info'] = []; } } // Detect device model @@ -811,7 +811,7 @@ class MTProto extends AsyncConstruct implements TLCallback } catch (\danog\MadelineProto\Exception $e) { $device_model = 'Web server'; } - if ($settings['app_info']['api_id'] === 6) { + if (($settings['app_info']['api_id'] ?? 0) === 6) { // TG DEV NOTICE: these app info spoofing measures were implemented for NON-MALICIOUS purposes. // All accounts registered with a custom API ID require manual verification through recover@telegram.org, to avoid instant permabans. // This makes usage of all MTProto libraries very difficult, at least for new users. @@ -834,7 +834,7 @@ class MTProto extends AsyncConstruct implements TLCallback } catch (\danog\MadelineProto\Exception $e) { $system_version = PHP_VERSION; } - if ($settings['app_info']['api_id'] === 6) { + if (($settings['app_info']['api_id'] ?? 0) === 6) { // TG DEV NOTICE: these app info spoofing measures were implemented for NON-MALICIOUS purposes. // All accounts registered with a custom API ID require manual verification through recover@telegram.org, to avoid instant permabans. // This makes usage of all MTProto libraries very difficult, at least for new users. @@ -865,7 +865,7 @@ class MTProto extends AsyncConstruct implements TLCallback } // Detect language pack $lang_pack = ''; - if ($settings['app_info']['api_id'] === 6) { + if (($settings['app_info']['api_id'] ?? 0) === 6) { // TG DEV NOTICE: these app info spoofing measures were implemented for NON-MALICIOUS purposes. // All accounts registered with a custom API ID require manual verification through recover@telegram.org, to avoid instant permabans. // This makes usage of all MTProto libraries very difficult, at least for new users. @@ -885,7 +885,7 @@ class MTProto extends AsyncConstruct implements TLCallback } // Detect app version $app_version = self::RELEASE.' ('.self::V.', '.Magic::$revision.')'; - if ($settings['app_info']['api_id'] === 6) { + if (($settings['app_info']['api_id'] ?? 0) === 6) { // TG DEV NOTICE: these app info spoofing measures were implemented for NON-MALICIOUS purposes. // All accounts registered with a custom API ID require manual verification through recover@telegram.org, to avoid instant permabans. // This makes usage of all MTProto libraries very difficult, at least for new users. diff --git a/tests/makephar.sh b/tests/makephar.sh index 18238342..2da6c660 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -128,9 +128,9 @@ echo "$TRAVIS_COMMIT_MESSAGE" | grep -i "subrelease" && { cp release$php$branch release$php cp madeline$php$branch.phar madeline$php.phar } -while [ "$(cat release$branch)" != "$TRAVIS_COMMIT" ]; sleep 1; git pull;done -while [ "$(cat release70$branch)" != "$TRAVIS_COMMIT" ]; sleep 1; git pull;done -while [ "$(cat release5$branch)" != "$TRAVIS_COMMIT" ]; sleep 1; git pull;done +while [ "$(cat release$branch)" != "$TRAVIS_COMMIT" ]; do sleep 1; git pull;done +while [ "$(cat release70$branch)" != "$TRAVIS_COMMIT" ]; do sleep 1; git pull;done +while [ "$(cat release5$branch)" != "$TRAVIS_COMMIT" ]; do sleep 1; git pull;done git add -A