Hybridauth ソーシャル ログインを使用しています。ユーザーが Facebook で認証すると、次のエラーが表示されます。
警告: array_key_exists() [function.array-key-exists]: 2 番目の引数は、1328 行目の /hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php の配列またはオブジェクトのいずれかである必要があります
なぜこれが起こっているのかについての私の推測 (おそらく間違っている) は、Hybridauth に渡すために使用されるパラメーターがブラウザーの URL から取得されるためであり、page=register と connected_with=facebook の 2 つがあります。Hybridauth は 2 番目のもののみを必要とします...
実際には認証されますが、このエラーを取り除きたいです。この警告が発生するのはなぜですか? 非表示にする方法はありますか?
これはエラーのビットです:
/**
* Get the base domain used for the cookie.
*/
protected function getBaseDomain() {
// The base domain is stored in the metadata cookie
// if not we fallback to the current hostname
$metadata = $this->getMetadataCookie();
if (array_key_exists('base_domain', $metadata) &&
!empty($metadata['base_domain'])) {
return trim($metadata['base_domain'], '.');
}
return $this->getHttpHost();
}
警告が発生するのは次のコードです。
/**
* Destroy the current session
*/
public function destroySession() {
$this->accessToken = null;
$this->signedRequest = null;
$this->user = null;
$this->clearAllPersistentData();
// JavaScript sets a cookie that will be used in getSignedRequest
// that we need to clear if we can
$cookie_name = $this->getSignedRequestCookieName();
if (array_key_exists($cookie_name, $_COOKIE)) {
unset($_COOKIE[$cookie_name]);
if (!headers_sent()) {
$base_domain = $this->getBaseDomain();
setcookie($cookie_name, '', 1, '/', '.'.$base_domain);
} else {
// @codeCoverageIgnoreStart
self::errorLog(
'There exists a cookie that we wanted to clear that we couldn\'t '.
'clear because headers was already sent. Make sure to do the first '.
'API call before outputting anything.'
);
// @codeCoverageIgnoreEnd
}
}
}