From 3cbbf43ee9514ed0f64d1ccdc08b10fc0d480e08 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 12 Jul 2003 16:50:14 +0000 Subject: [PATCH] Added autoindexing. --- index.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index f4f8660..e888743 100644 --- 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 {{{ -- 2.43.0