Skip to content

Commit

Permalink
Fixed: Links to directories are now working with or without a trailin…
Browse files Browse the repository at this point in the history
…g `/`
  • Loading branch information
til-schneider committed Mar 14, 2016
1 parent 127b3bb commit efa639d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/logic/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ private function getArticleFilename($requestPathArray) {
$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
Expand Down

0 comments on commit efa639d

Please sign in to comment.