트위터 소셜 댓글 사용시 Could not connect to Twitter. Refresh the page or try again later. 이전에 나오는 Warning: Undefined array key 오류 수정

This commit is contained in:
kagla
2021-08-23 07:24:24 +00:00
parent bdd52dae6f
commit 38308f887b
2 changed files with 3 additions and 3 deletions

View File

@ -13,8 +13,8 @@ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->getRequestToken(OAUTH_CALLBACK);
/* Save temporary credentials to session. */
$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$_SESSION['oauth_token'] = $token = @$request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = @$request_token['oauth_token_secret'];
//print_r2($_SESSION); exit;

View File

@ -77,7 +77,7 @@ class TwitterOAuth {
$parameters['oauth_callback'] = $oauth_callback;
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
$token = OAuthUtil::parse_parameters($request);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
$this->token = new OAuthConsumer(@$token['oauth_token'], @$token['oauth_token_secret']);
return $token;
}