From: Michael Date: Tue, 30 Jan 2018 18:52:06 +0000 (+0000) Subject: Quit if twitter addon is not configured X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=633c54d64287bf8d4f5801a22a88ddd1a77d3a14;p=friendica-addons.git Quit if twitter addon is not configured --- diff --git a/twitter/twitter.php b/twitter/twitter.php index bca5e7db..1863b8bc 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -158,6 +158,12 @@ function twitter_follow(App $a, &$contact) $otoken = PConfig::get($uid, 'twitter', 'oauthtoken'); $osecret = PConfig::get($uid, 'twitter', 'oauthsecret'); + // If the addon is not configured (general or for this user) quit here + if (empty($ckey) || empty($csecret) || empty($otoken) || empty($osecret)) { + $contact = false; + return; + } + $connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret); $connection->post('friendships/create', ['screen_name' => $nickname]);