1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-02 22:57:26 +02:00

Fixed: Links to directories are now working with or without a trailing /

This commit is contained in:
til-schneider
2016-03-14 15:15:55 +01:00
parent 127b3bb03a
commit efa639d6cf

View File

@@ -177,8 +177,8 @@ class Main {
$articleFilename = implode('/', $requestPathArray); $articleFilename = implode('/', $requestPathArray);
// Support `index.md` for directories // Support `index.md` for directories
if ($articleFilename == '' || substr($articleFilename, -1) == '/') { if (is_dir($articleBaseDir . $articleFilename) || substr($articleFilename, -1) == '/') {
$articleFilename = $articleFilename . 'index.md'; $articleFilename = rtrim($articleFilename, '/') . '/index.md';
} }
// Make the extension `.md` optional // Make the extension `.md` optional