瀏覽代碼

Fix phpunit

Laurent Destailleur 3 年之前
父節點
當前提交
b0e0ceb8f6

+ 2 - 1
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

+ 2 - 1
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