From 1f669a31a08a817c5614386658d01f8827bb4372 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 8 Oct 2019 20:12:24 +0200 Subject: [PATCH 1/3] [ticket/16181] Enforce string data type PHPBB3-16181 --- phpBB/phpbb/auth/provider/oauth/oauth.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 0d94acfbca..8352fb649d 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -216,10 +216,15 @@ class oauth extends \phpbb\auth\provider\base $this->service_providers[$service_name]->set_external_service_provider($service); $unique_id = $this->service_providers[$service_name]->perform_auth_login(); - // Check to see if this provider is already assosciated with an account + /** + * Check to see if this provider is already assosciated with an account. + * + * Enforcing a data type to make sure it are strings and not integers, + * so values are quoted in the SQL WHERE statement. + */ $data = array( - 'provider' => $service_name_original, - 'oauth_provider_id' => $unique_id + 'provider' => (string) $service_name_original, + 'oauth_provider_id' => (string) $unique_id ); $sql = 'SELECT user_id FROM ' . $this->auth_provider_oauth_token_account_assoc . ' From 29957a92ef14a368a1a53a9620955f34eb8536f8 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 8 Oct 2019 20:19:46 +0200 Subject: [PATCH 2/3] [ticket/16181] Fix spelling mistake in associated PHPBB3-16181 --- phpBB/phpbb/auth/provider/oauth/oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 8352fb649d..1609128b92 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -217,7 +217,7 @@ class oauth extends \phpbb\auth\provider\base $unique_id = $this->service_providers[$service_name]->perform_auth_login(); /** - * Check to see if this provider is already assosciated with an account. + * Check to see if this provider is already associated with an account. * * Enforcing a data type to make sure it are strings and not integers, * so values are quoted in the SQL WHERE statement. From ebdb38857c5409e63853cd4d24906f18cb64267d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 20 Oct 2019 20:54:39 +0200 Subject: [PATCH 3/3] [ticket/16181] Fix typo in comment PHPBB3-16181 --- phpBB/phpbb/auth/provider/oauth/oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 1609128b92..e3f8394bba 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -219,7 +219,7 @@ class oauth extends \phpbb\auth\provider\base /** * Check to see if this provider is already associated with an account. * - * Enforcing a data type to make sure it are strings and not integers, + * Enforcing a data type to make data contains strings and not integers, * so values are quoted in the SQL WHERE statement. */ $data = array(