Просмотр исходного кода

Ticket #3417 - Apps Market: Improve package downloading.

AntonLV 4 лет назад
Родитель
Сommit
58ccfe02f1

+ 2 - 1
studio/classes/BxDolStudioInstallerUtils.php

@@ -413,6 +413,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
     {
         $aItem = $this->getAccessObject(true)->loadItems(array(
             'method' => 'download_file', 
+            'version' => bx_get_ver(),
             'file_id' => $iFileId
         ));
 
@@ -529,7 +530,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSin
             return _t('_adm_str_err_cannot_write');
         }
 
-        $sContent = urldecode($aItem['content']);
+        $sContent = base64_decode(urldecode($aItem['content']));
         if(!fwrite($rHandler, $sContent, strlen($sContent))) {
             umask($iUmaskSave);
             return _t('_adm_str_err_cannot_write');

+ 7 - 2
studio/classes/BxDolStudioStore.php

@@ -402,9 +402,14 @@ class BxDolStudioStore extends BxTemplStudioWidget
 
     protected function loadProduct($sModuleName)
     {
-        $oJson = BxDolStudioJson::getInstance();
+        $sVersion = bx_get_ver();
 
-        return $oJson->load($this->sStoreDataUrlPublic . 'json_get_product_by_name', array('value' => $sModuleName, 'client' => $this->iClient, 'key' => $this->sClientKey));
+        return BxDolStudioJson::getInstance()->load($this->sStoreDataUrlPublic . 'json_get_product_by_name', array(
+            'value' => $sModuleName, 
+            'client' => $this->iClient, 
+            'key' => $this->sClientKey,
+            'version' => $sVersion
+        ));
     }
 
     /*