From 5de602a1fd3db635879227c9c61b6c0c3ef8ffe4 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 29 Aug 2018 17:55:56 +0200 Subject: [PATCH] Fixes to the update loop --- docs | 2 +- src/danog/MadelineProto/Wrappers/Loop.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs b/docs index fbf63446..126051ec 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit fbf634469595ff88e833e13964a797a79f4dc42f +Subproject commit 126051eca8b037c1b911a4546d0440dc798ce3ce diff --git a/src/danog/MadelineProto/Wrappers/Loop.php b/src/danog/MadelineProto/Wrappers/Loop.php index 91d14d60..176829b7 100644 --- a/src/danog/MadelineProto/Wrappers/Loop.php +++ b/src/danog/MadelineProto/Wrappers/Loop.php @@ -30,6 +30,9 @@ trait Loop if (in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'get_updates_update_handler'], 'get_updates_update_handler'])) { return true; } + if (!is_callable($this->loop_callback) || (is_array($this->loop_callback) && $this->loop_callback[1] === 'onLoop' && !method_exists(...$this->loop_callback))) { + $this->loop_callback = null; + } if (php_sapi_name() !== 'cli') { try { set_time_limit(-1);