From 00376401fc9e23c8b4417f904c0199689e4bacbd Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Sun, 15 Mar 2020 10:14:20 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=AE=89=E8=A3=85=E5=8C=85=20md5=20=E5=80=BC?= =?UTF-8?q?=E9=83=BD=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/admin/System.php | 2 ++ extend/Upgrade.php | 2 +- public/static/app/js/app.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/index/controller/admin/System.php b/application/index/controller/admin/System.php index a7832662..77641de1 100644 --- a/application/index/controller/admin/System.php +++ b/application/index/controller/admin/System.php @@ -104,8 +104,10 @@ class System extends Base $upgradeFile = app()->getRuntimePath() . 'upgrade.zip';// 判断是否存在安装包 $file = file_exists($upgradeFile) ? $upgradeFile : $upgrade->download($release->url); + // 校验 MD5 if (md5_file($file) !== $release->md5) { + @unlink(app()->getRootPath() . $backup); throw new \Exception('安装包损坏, 请稍后重试'); } diff --git a/extend/Upgrade.php b/extend/Upgrade.php index b7b88611..122f51da 100644 --- a/extend/Upgrade.php +++ b/extend/Upgrade.php @@ -88,7 +88,7 @@ class Upgrade curl_setopt($curl, CURLOPT_TIMEOUT, 180); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 180); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - curl_setopt($curl, CURLOPT_HEADER, 1); + curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $contents = curl_exec($curl); diff --git a/public/static/app/js/app.js b/public/static/app/js/app.js index fd8d8e07..f1cc41a8 100644 --- a/public/static/app/js/app.js +++ b/public/static/app/js/app.js @@ -156,7 +156,7 @@ var app = { modal: true, buttons: [], closeOnEsc: false, - content: '
升级中, 请不要关闭窗口...
' + content: '
升级中, 请不要关闭窗口...
' }); $d.$dialog.css({'max-width': '300px'}); mdui.mutation();