Added proper 404 errors on file or directory not found
[bizou.git] / index.php
index a05287d..03989d6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -103,6 +103,11 @@ $otherFiles = array();
 
 $realDir = IMAGES_DIR.$shortPath;
 
+if (! is_dir($realDir)) {
+       header("HTTP/1.1 404 Not Found");
+       die("Directory Not Found");
+}
+
 foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..')
 {
        if (is_dir("$realDir/$file"))