From b0e0ceb8f6a5945fa238f226cda0d97401a3d8a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jun 2022 14:59:15 +0200 Subject: [PATCH] Fix phpunit --- htdocs/core/modules/oauth/stripelive_oauthcallback.php | 3 ++- htdocs/core/modules/oauth/stripetest_oauthcallback.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index c9bb575a32a..bf9656df783 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -89,7 +89,8 @@ if (GETPOST('state')) { // Instantiate the Api service using the credentials, http client and storage mechanism for the token //$apiService = $serviceFactory->createService('StripeTest', $credentials, $storage, $requestedpermissionsarray); -$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeLive".$db->escape($keyforprovider ? '-'.$keyforprovider : '')."', entity=".$conf->entity; +$servicesuffix = ($keyforprovider ? '-'.$keyforprovider : ''); +$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeLive".$db->escape($servicesuffix)."', entity = ".((int) $conf->entity); $db->query($sql); // access type needed to have oauth provider refreshing token diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index c4dd6ad9b5f..64d55fba760 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -89,7 +89,8 @@ if (GETPOST('state')) { // Instantiate the Api service using the credentials, http client and storage mechanism for the token //$apiService = $serviceFactory->createService('StripeTest', $credentials, $storage, $requestedpermissionsarray); -$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeTest".$db->escape($keyforprovider ? '-'.$keyforprovider : '')."', entity=".$conf->entity; +$servicesuffix = ($keyforprovider ? '-'.$keyforprovider : ''); +$sql = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token SET service = 'StripeTest".$db->escape($servicesuffix)."', entity = ".((int) $conf->entity); $db->query($sql); // access type needed to have oauth provider refreshing token