From 0776242e6f7202ed5d64fb198db80d5ba60b8e0b Mon Sep 17 00:00:00 2001 From: metowolf Date: Thu, 8 Mar 2018 14:33:16 +0800 Subject: [PATCH] =?UTF-8?q?:cherries:=20=E5=AE=8C=E5=96=84=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Action.php | 7 ++----- shasum.txt | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Action.php b/Action.php index 9d39ce1..d90109d 100644 --- a/Action.php +++ b/Action.php @@ -328,11 +328,8 @@ private function update() foreach ($shasum as $remote) { list($remote_sha256, $filename) = explode(' ', $remote); - if (!file_exists(__DIR__.'/'.$filename)) { - continue; - } - $local_sha256 = hash('sha256', file_get_contents(__DIR__.'/'.$filename)); - if (!hash_equals($local_sha256, $remote_sha256)) { + if (!file_exists(__DIR__.'/'.$filename) || + !hash_equals(hash('sha256', file_get_contents(__DIR__.'/'.$filename)), $remote_sha256)) { echo "下载 ".$filename; $url = 'https://raw.githubusercontent.com/MoePlayer/APlayer-Typecho/master'.substr($filename, 1); diff --git a/shasum.txt b/shasum.txt index c68b37c..a030783 100644 --- a/shasum.txt +++ b/shasum.txt @@ -1,4 +1,4 @@ -0ee891ceb5f6a8d4cd94ef256abd7887f2e08ff90eed087a5553b70575cbe69d ./Action.php +437cbad1f79ae3fa930c35e5ba6a194ed77cce1cb35a3560af0c7279d33fdbd1 ./Action.php aa3c0deef2f5b5524f9e7cbd1809d14d51e0a5eae8f21e183483c84c28b86e46 ./assets/APlayer.min.js 6c1db3ae0b983df3e9395aa133875e64c7cb6321064c982d507fa7d82f7258f3 ./assets/editer.js efd4f31c32ad090a109c0fb30a04c007093aa3d304e26adcc2cb75153812ecb1 ./assets/Meting.min.js