Browse Source

bug fix: dir and filename support 0

master
filesite 1 week ago
parent
commit
a11b001968
  1. 2
      lib/DirScanner.php
  2. 4
      themes/beauty/controller/ListController.php

2
lib/DirScanner.php

@ -79,7 +79,7 @@ Class DirScanner {
//判断目录名或文件名是否合法 //判断目录名或文件名是否合法
//不允许包含斜杠/,反斜杠\,单引号',双引号",空格字符 //不允许包含斜杠/,反斜杠\,单引号',双引号"字符
//忽略.开头的隐藏文件 //忽略.开头的隐藏文件
private function isValid($name) { private function isValid($name) {
return str_replace(['/', '\\', "'", '"'], '', $name) == $name && !preg_match('/^\..+/', $name); return str_replace(['/', '\\', "'", '"'], '', $name) == $name && !preg_match('/^\..+/', $name);

4
themes/beauty/controller/ListController.php

@ -104,9 +104,9 @@ Class ListController extends Controller {
$files = array(); $files = array();
$dir_exts = array(); $dir_exts = array();
foreach ($scanResults as $id => $item) { foreach ($scanResults as $id => $item) {
if (!empty($item['directory'])) { if (strlen($item['directory']) > 0) {
array_push($dirs, $item); array_push($dirs, $item);
}else if (!empty($item['filename'])) { }else if (strlen($item['filename']) > 0) {
array_push($files, $item); array_push($files, $item);
}else { }else {
$dir_exts = array_merge($item, $dir_exts); $dir_exts = array_merge($item, $dir_exts);

Loading…
Cancel
Save