1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-20 07:42:09 +02:00

Merge pull request #6128 from 3D-I/ticket/16689

[ticket/16689] Fix SQL errors for Bitly OAuth
This commit is contained in:
Máté Bartus 2021-01-26 18:42:02 +01:00 committed by GitHub
commit 9cc910cb34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -95,6 +95,7 @@ $lang = array_merge($lang, array(
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.',
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.',
'AUTH_PROVIDER_OAUTH_ERROR_REQUEST' => 'Something went wrong when processing your OAuth request.',
'AUTH_PROVIDER_OAUTH_RETURN_ERROR' => 'The external service returned a wrong value therefore your request can not be processed.',
'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created',
'AUTH_PROVIDER_OAUTH_SERVICE_BITLY' => 'Bitly',
'AUTH_PROVIDER_OAUTH_SERVICE_FACEBOOK' => 'Facebook',

View File

@ -77,6 +77,12 @@ class bitly extends base
throw new exception('AUTH_PROVIDER_OAUTH_ERROR_REQUEST');
}
// Prevent SQL error
if (!isset($result['data']['login']))
{
throw new exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR');
}
// Return the unique identifier returned from bitly
return $result['data']['login'];
}
@ -101,6 +107,12 @@ class bitly extends base
throw new exception('AUTH_PROVIDER_OAUTH_ERROR_REQUEST');
}
// Prevent SQL error
if (!isset($result['data']['login']))
{
throw new exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR');
}
// Return the unique identifier
return $result['data']['login'];
}