From fbbc810d3444de899091b177929ae38325e92d2d Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Mon, 14 Apr 2014 15:03:42 -0300 Subject: [PATCH] make sure TwitterOAuth is not available before including it to avoid conflict with other plugins using the same library --- twitter/callback.php | 5 +++-- twitter/connect.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/twitter/callback.php b/twitter/callback.php index 4146d3c..eafab74 100644 --- a/twitter/callback.php +++ b/twitter/callback.php @@ -10,8 +10,9 @@ * Verify credentials and redirect to based on response from Twitter. */ -/* Start session and load lib */ -require_once('twitteroauth/twitteroauth.php'); +if ( ! class_exists( 'TwitterOAuth' ) ) { + require_once 'twitteroauth/twitteroauth.php'; +} /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); diff --git a/twitter/connect.php b/twitter/connect.php index 9505719..15e2dcf 100644 --- a/twitter/connect.php +++ b/twitter/connect.php @@ -1,6 +1,8 @@