[ticket/16799] Use offsetExists() method instead of array_key_exists()

PHPBB3-16799
This commit is contained in:
rxu 2021-07-01 03:04:38 +07:00
parent 7b5ad8bb74
commit dd62829f96
No known key found for this signature in database
GPG key ID: 8EF9758E0A54D19E

View file

@ -163,7 +163,7 @@ class oauth extends base
$provider = $this->request->variable('oauth_service', '', false);
$service_name = $this->get_service_name($provider);
if ($provider === '' || !array_key_exists($service_name, (array) $this->service_providers))
if ($provider === '' || !$this->service_providers->offsetExists($service_name))
{
return [
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@ -452,7 +452,7 @@ class oauth extends base
$service_name = $this->get_service_name($link_data['oauth_service']);
if (!array_key_exists($service_name, (array) $this->service_providers))
if (!$this->service_providers->offsetExists($service_name))
{
return 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST';
}