From c885ebfac3e3bbc2f4d8536a6297a1ba11446c3b Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Fri, 17 Nov 2023 10:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/system/log/SystemFileServices.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/crmeb/app/services/system/log/SystemFileServices.php b/crmeb/app/services/system/log/SystemFileServices.php index 2283e5816..cd4ee62b7 100644 --- a/crmeb/app/services/system/log/SystemFileServices.php +++ b/crmeb/app/services/system/log/SystemFileServices.php @@ -253,15 +253,14 @@ class SystemFileServices extends BaseServices } else { $dir = $dir . '/' . $fileDir; } - $list = scandir($dir); + //获取目录列表 + $list = array_diff(scandir($dir), array('.', '..')); foreach ($list as $key => $v) { - if ($v != '.' && $v != '..') { - if (is_dir($dir . DS . $v)) { - $fileAll['dir'][] = FileClass::listInfo($dir . DS . $v); - } - if (is_file($dir . DS . $v)) { - $fileAll['file'][] = FileClass::listInfo($dir . DS . $v); - } + if (is_dir($dir . DS . $v)) { + $fileAll['dir'][] = FileClass::listInfo($dir . DS . $v); + } + if (is_file($dir . DS . $v)) { + $fileAll['file'][] = FileClass::listInfo($dir . DS . $v); } } //兼容windows