From 5e1ee836b7e1e81fa0790330ab07157124f50aa2 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Mon, 20 Jan 2020 22:31:52 -0500 Subject: [PATCH] Fixed API-C - Undefined offset: 0 This was happening because I was calling die() in an API call...which preemptively killed the script. The API didn't set some variables and everything broke. Better not to die() anyways so that stuff actually gets logged. --- api/ecobee.php | 1 - api/patreon.php | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/api/ecobee.php b/api/ecobee.php index 11cdcb9..f1fc43f 100644 --- a/api/ecobee.php +++ b/api/ecobee.php @@ -28,7 +28,6 @@ class ecobee extends external_api { */ public function authorize() { header('Location: https://api.ecobee.com/authorize?response_type=code&client_id=' . $this->setting->get('ecobee_client_id') . '&redirect_uri=' . $this->setting->get('ecobee_redirect_uri') . '&scope=smartRead'); - die(); } /** diff --git a/api/patreon.php b/api/patreon.php index 9211ffb..9177d6c 100644 --- a/api/patreon.php +++ b/api/patreon.php @@ -27,7 +27,6 @@ class patreon extends external_api { */ public function authorize() { header('Location: https://www.patreon.com/oauth2/authorize?response_type=code&client_id=' . $this->setting->get('patreon_client_id') . '&redirect_uri=' . $this->setting->get('patreon_redirect_uri') . '&scope=identity'); - die(); } /** @@ -42,12 +41,10 @@ class patreon extends external_api { $this->api('user', 'sync_patreon_status'); } - echo ''; + echo '