From 7c955c481bfa79f80dea7f9fe67304058ecfde89 Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Mon, 14 Apr 2025 07:14:23 +0200 Subject: [PATCH] fix: Make sure directories don't get overriden by entries in outline --- src/Controller/MainController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 3da9a49..59d220e 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -64,7 +64,6 @@ final class MainController extends AbstractController foreach ($finder as $file) { $current = &$tree; - // Dunno why it is undefined, it works foreach (explode('/', $file->getRelativePath()) as $part) { if ($part === '') break; @@ -74,7 +73,9 @@ final class MainController extends AbstractController $current = &$current[$part]; } - $current[$file->getFilenameWithoutExtension()] = []; + if (!isset($current[$file->getFilenameWithoutExtension()])) { + $current[$file->getFilenameWithoutExtension()] = []; + } } return $this->render('main/index.html.twig', [