From 356dc5b0bce301b1a124bdcef3e108d333e5afe2 Mon Sep 17 00:00:00 2001 From: DiscuzX <153619335@qq.com> Date: Thu, 20 May 2021 13:09:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0UC=E6=96=87=E4=BB=B6=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/uc_server/plugin/filecheck/plugin.php | 24 ++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/upload/uc_server/plugin/filecheck/plugin.php b/upload/uc_server/plugin/filecheck/plugin.php index 7e7c77a4a..e3a1f12c5 100644 --- a/upload/uc_server/plugin/filecheck/plugin.php +++ b/upload/uc_server/plugin/filecheck/plugin.php @@ -21,12 +21,18 @@ class control extends pluginbase { $applist = $_ENV['app']->get_apps(); $this->view->assign('applist', $applist); - $this->checkfiles('./', '\.php', 0, '\.php|\.xml'); - $this->checkfiles('control/', '\.php'); - $this->checkfiles('model/', '\.php'); - $this->checkfiles('lib/', '\.php'); + $this->checkfiles('./', '', 0); + $this->checkfiles('data/', '\.htm'); + $this->checkfiles('api/', '\.php|\.htm'); + $this->checkfiles('control/', '\.php|\.htm|\.md5', 1, 'ucfiles.md5'); + $this->checkfiles('model/', '\.php|\.htm'); + $this->checkfiles('lib/', '\.php|\.htm'); + $this->checkfiles('plugin/', '\.php|\.htm|\.xml'); + $this->checkfiles('upgrade/', '\.php'); + $this->checkfiles('images/', '\..+?'); + $this->checkfiles('js/', '\.js|\.htm'); + $this->checkfiles('release/', '\.php'); $this->checkfiles('view/', '\.php|\.htm'); - $this->checkfiles('js/', '\.js'); foreach($ucfiles as $line) { $file = trim(substr($line, 34)); @@ -103,11 +109,15 @@ class control extends pluginbase { while($entry = @readdir($dir)) { $file = $currentdir.$entry; - if($entry != '.' && $entry != '..' && (preg_match($exts, $entry) || $sub && is_dir($file)) && !in_array($entry, $skips)) { + if($entry != '.' && $entry != '..' && (($ext && preg_match($exts, $entry) || !$ext) || $sub && is_dir($file)) && !in_array($entry, $skips)) { if($sub && is_dir($file)) { $this->checkfiles($file.'/', $ext, $sub, $skip); } else { - $this->md5data[$file] = md5_file($file); + if(is_dir($file)) { + $this->md5data[$file] = md5($file); + } else { + $this->md5data[$file] = md5_file($file); + } } } } -- Gitee