Parcourir la source

Ticket #4272 - Studio Store: Purchases/Updates cannot load data correctly.

AntonLV il y a 3 ans
Parent
commit
e53dfe48b5

+ 1 - 1
studio/classes/BxDolStudioJson.php

@@ -34,7 +34,7 @@ class BxDolStudioJson extends BxDolFactory implements iBxDolSingleton
 
     public function load($sUrl, $aParams = array())
     {
-        $sContent = bx_file_get_contents($sUrl, $aParams);
+        $sContent = bx_file_get_contents($sUrl, $aParams, 'post');
         if(empty($sContent))
             return false;
 

+ 6 - 6
studio/classes/BxDolStudioOAuthOAuth2.php

@@ -123,7 +123,7 @@ class BxDolStudioOAuthOAuth2 extends BxDolStudioOAuth implements iBxDolSingleton
     protected function fetch($aParams = array())
     {
         if(!$this->isAuthorized())
-            return array();
+            return [];
 
         $iTimeout = 120;
         if(ini_get('safe_mode') == 0) {
@@ -132,16 +132,16 @@ class BxDolStudioOAuthOAuth2 extends BxDolStudioOAuth implements iBxDolSingleton
         }
 
         $sHttpCode = null;
-        $sResponse = bx_file_get_contents($this->sApiUrl . 'api/market', $aParams, 'get', array(
+        $sResponse = bx_file_get_contents($this->sApiUrl . 'api/market', $aParams, 'post', [
             'Authorization: Bearer ' . $this->oSession->getValue(self::$sSessionKeyToken),
-        ), $sHttpCode, array(), $iTimeout);
+        ], $sHttpCode, [], $iTimeout);
 
         //echo $sResponse; exit;		//--- Uncomment to debug
         if (!$sResponse || ($aResponse = json_decode($sResponse, true)) === NULL || !$aResponse || isset($aResponse['error'])) {
-        	if(isset($aResponse['error']) && $this->isReloginRequired($aResponse['error']))
-        		$this->unsetAuthorizedUser();
+            if(isset($aResponse['error']) && $this->isReloginRequired($aResponse['error']))
+                $this->unsetAuthorizedUser();
 
-			return isset($aResponse['error_description']) ? $aResponse['error_description'] : _t('_error occured');
+            return isset($aResponse['error_description']) ? $aResponse['error_description'] : _t('_error occured');
         }
 
         return $aResponse['data'];