]> git.llucax.com Git - software/bife/web.git/commitdiff
Added autoindexing.
authorLeandro Lucarella <llucax@gmail.com>
Sat, 12 Jul 2003 16:50:14 +0000 (16:50 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sat, 12 Jul 2003 16:50:14 +0000 (16:50 +0000)
index.php

index f4f86606f9bfab7c318b0db7bce3efdcea1ec6b1..e88874394e64f04f9b1bf1e06791d70099306fdf 100644 (file)
--- a/index.php
+++ b/index.php
@@ -34,9 +34,15 @@ require_once 'BIFE/Translate.php';
 // }}}
 
 // Selects the file to view {{{
-$file = (@$_SERVER['PATH_INFO'] and ($_SERVER['PATH_INFO'] != '/'))
-    ? ".{$_SERVER['PATH_INFO']}"
-    : 'index.xbf';
+if (@$_SERVER['PATH_INFO']) {
+    $file = $_SERVER['PATH_INFO'];
+    // If it ends with a slash it's a directory so we add index.xbf.
+    if (substr($_SERVER['PATH_INFO'], strlen($_SERVER['PATH_INFO'])-1) == '/') {
+        $file .= 'index.xbf';
+    }
+} else {
+    $file = 'index.xbf';
+}
 // }}}
 
 // Looks if we want to show the source {{{