From: Leandro Lucarella Date: Sat, 12 Jul 2003 16:50:14 +0000 (+0000) Subject: Added autoindexing. X-Git-Tag: svn_import~4 X-Git-Url: https://git.llucax.com/software/bife/web.git/commitdiff_plain/3cbbf43ee9514ed0f64d1ccdc08b10fc0d480e08 Added autoindexing. --- 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 {{{