1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-01-17 12:48:15 +01: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);
// 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