🍒 完善升级模块

This commit is contained in:
metowolf 2018-03-08 14:33:16 +08:00
parent b66f1b0957
commit 0776242e6f
2 changed files with 3 additions and 6 deletions

View File

@ -328,11 +328,8 @@ class Meting_Action extends Typecho_Widget implements Widget_Interface_Do
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);

View File

@ -1,4 +1,4 @@
0ee891ceb5f6a8d4cd94ef256abd7887f2e08ff90eed087a5553b70575cbe69d ./Action.php
437cbad1f79ae3fa930c35e5ba6a194ed77cce1cb35a3560af0c7279d33fdbd1 ./Action.php
aa3c0deef2f5b5524f9e7cbd1809d14d51e0a5eae8f21e183483c84c28b86e46 ./assets/APlayer.min.js
6c1db3ae0b983df3e9395aa133875e64c7cb6321064c982d507fa7d82f7258f3 ./assets/editer.js
efd4f31c32ad090a109c0fb30a04c007093aa3d304e26adcc2cb75153812ecb1 ./assets/Meting.min.js