Bugfix: check whether file is directory unpon pageindex recreation. Fixes #42.

This commit is contained in:
Starbeamrainbowlabs 2015-12-05 18:34:50 +00:00
parent 8924c7b9ac
commit 29399a379c
1 changed files with 2 additions and 1 deletions

View File

@ -374,7 +374,8 @@ if(!file_exists($paths->pageindex))
// Extract the name of the (sub)page without the ".md"
$pagekey = utf8_encode(substr($newentry->filename, 0, -3));
if(file_exists($env->storage_prefix . $pagekey))
if(file_exists($env->storage_prefix . $pagekey) && // If it exists...
!is_dir($env->storage_prefix . $pagekey)) // ...and isn't a directory
{
// This page (potentially) has an associated file!
// Let's investigate.