X-Git-Url: https://git.llucax.com/software/bife/web.git/blobdiff_plain/4b60e8396cd7c3f5848d022272c469de941e0bc6..3b5354b2d2c921d4921687e824ea32b3bfd8f0b2:/index.php diff --git a/index.php b/index.php index 862cc1f..e888743 100644 --- a/index.php +++ b/index.php @@ -27,8 +27,6 @@ // // Inicialization {{{ -#ini_set('include_path', '../src:../../hit/src:../../bife/src:'. -# ini_get('include_path')); umask('002'); require_once 'HTML/Template/HIT.php'; require_once 'BIFE/Parser.php'; @@ -36,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 {{{