update idpexception to account for empty strings

Some providers (ex. Google) specify an error response object which is an empty string in cases where a 403/401 are returned. This will force the exception to check that the value isset and it is not an empty string which will help prevent the Unknown error case from occurring.
oauth1test
Geoff Lancaster 2015-01-16 15:19:14 -06:00
parent ae0183803e
commit a91f3788cb
1 changed files with 2 additions and 2 deletions

View File

@ -12,10 +12,10 @@ class IDPException extends \Exception
$code = isset($result['code']) ? $result['code'] : 0;
if (isset($result['error'])) {
if (isset($result['error']) && $result['error'] !== '') {
// OAuth 2.0 Draft 10 style
$message = $result['error'];
} elseif (isset($result['message'])) {
} elseif (isset($result['message']) && $result['message'] !== '') {
// cURL style
$message = $result['message'];
} else {