From efa639d6cfd6ae50fabc41f07944a44f025073c6 Mon Sep 17 00:00:00 2001 From: til-schneider Date: Mon, 14 Mar 2016 15:15:55 +0100 Subject: [PATCH] Fixed: Links to directories are now working with or without a trailing `/` --- src/server/logic/Main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/logic/Main.php b/src/server/logic/Main.php index 36b5d70..ae8b4b3 100644 --- a/src/server/logic/Main.php +++ b/src/server/logic/Main.php @@ -177,8 +177,8 @@ class Main { $articleFilename = implode('/', $requestPathArray); // Support `index.md` for directories - if ($articleFilename == '' || substr($articleFilename, -1) == '/') { - $articleFilename = $articleFilename . 'index.md'; + if (is_dir($articleBaseDir . $articleFilename) || substr($articleFilename, -1) == '/') { + $articleFilename = rtrim($articleFilename, '/') . '/index.md'; } // Make the extension `.md` optional