Fix bug where parent directory is omitted

This commit is contained in:
Sheldon Lee 2024-03-11 18:58:28 +08:00
parent abec1c242f
commit 5e0bb59907

View File

@ -38,7 +38,7 @@ function main(): void {
foreach (scandir($directory) as $file) { foreach (scandir($directory) as $file) {
if ($file === ".") continue; if ($file === ".") continue;
if ($category === "" && $file === "..") continue; if ($category === "" && $file === "..") continue;
if (substr($file, 0, 1) === ".") continue; if (substr($file, 0, 1) === "." && $file !== "..") continue;
$path = add_seperator_ab("/", $category, $file); $path = add_seperator_ab("/", $category, $file);
$is_dir = is_dir(ROOT_DIR.IMG_DIR.$path); $is_dir = is_dir(ROOT_DIR.IMG_DIR.$path);