opauth / opauth

Multi-provider authentication framework for PHP
http://opauth.org
MIT License
1.65k stars 243 forks source link

E_WARNING when query fails #108

Open onyanov opened 9 years ago

onyanov commented 9 years ago

E_WARNING: implode(): Invalid arguments passed Stack trace …/vendor/opauth/opauth/lib/Opauth/OpauthStrategy.php (423) …/vendor/opauth/opauth/lib/Opauth/OpauthStrategy.php (364) …/vendor/opauth/vkontakte/VKontakteStrategy.php (49) …/vendor/opauth/opauth/lib/Opauth/OpauthStrategy.php (190) …/vendor/opauth/opauth/lib/Opauth/Opauth.php (118) …/vendor/opauth/opauth/lib/Opauth/Opauth.php (88)

OpauthStrategy.php (422 and 423) is: $content = file_get_contents($url, false, $context); $responseHeaders = implode("\r\n", $http_response_header);

The problem vatiable is $http_response_header (See http://php.net/manual/en/reserved.variables.httpresponseheader.php) I think you should check it like this: $content = file_get_contents($url, false, $context); if (isset($http_response_header)) { $responseHeaders = implode("\r\n", $http_response_header); }