Skip to content

Commit

Permalink
make sure TwitterOAuth is not available before including it to avoid …
Browse files Browse the repository at this point in the history
…conflict with other plugins using the same library
  • Loading branch information
rodrigoprimo committed Apr 14, 2014
1 parent 4f039d4 commit fbbc810
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions twitter/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 3 additions & 1 deletion twitter/connect.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

require_once('twitteroauth/twitteroauth.php');
if ( ! class_exists( 'TwitterOAuth' ) ) {
require_once 'twitteroauth/twitteroauth.php';
}

define('CONSUMER_KEY', get_option('social_connect_twitter_consumer_key'));
define('CONSUMER_SECRET', get_option('social_connect_twitter_consumer_secret'));
Expand Down

0 comments on commit fbbc810

Please sign in to comment.