From 76fcf777991efdce6b09dbd4f0ef9c07b1af59af Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 31 Mar 2021 15:26:13 +1100 Subject: [PATCH] Bump gateway protocol to 1.2 --- modules/system/classes/UpdateManager.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 929683dce..da91e3d37 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -613,8 +613,9 @@ class UpdateManager { $fileCode = $name . $hash; $filePath = $this->getFilePath($fileCode); + $innerPath = str_replace('.', '/', strtolower($name)); - if (!Zip::extract($filePath, plugins_path())) { + if (!Zip::extract($filePath, plugins_path($innerPath))) { throw new ApplicationException(Lang::get('system::lang.zip.extract_failed', ['file' => $filePath])); } @@ -655,8 +656,9 @@ class UpdateManager { $fileCode = $name . $hash; $filePath = $this->getFilePath($fileCode); + $innerPath = str_replace('.', '-', strtolower($name)); - if (!Zip::extract($filePath, themes_path())) { + if (!Zip::extract($filePath, themes_path($innerPath))) { throw new ApplicationException(Lang::get('system::lang.zip.extract_failed', ['file' => $filePath])); } @@ -958,7 +960,7 @@ class UpdateManager */ protected function applyHttpAttributes($http, $postData) { - $postData['protocol_version'] = '1.1'; + $postData['protocol_version'] = '1.2'; $postData['client'] = 'october'; $postData['server'] = base64_encode(serialize([