Project

General

Profile

« Previous | Next » 

Revision 13714

bugfix: web/index.php: fixed bug where full directory index would not display correctly if invoked as /index.php instead of / (caused by incorrect URL)

View differences:

trunk/web/index.php
3 3

  
4 4
$self_dir = ensure_suffix("/", dirname($_SERVER["SCRIPT_NAME"]));
5 5

  
6
function to_dir($path) { return dirname($path.'_'/*in case no filename*/); }
7

  
6 8
function by_prefix($url, $main_url=null)
7 9
{
8 10
	if (!isset($main_url)) $main_url = $url;
......
242 244
ob_end_flush();
243 245

  
244 246
# full directory index
245
# to fix bug, only display if invoked as "__.org/", not "__.org/index.php"
246
if (substr($_SERVER["SCRIPT_URI"], -1) === '/')
247
	fpassthru(fopen($_SERVER["SCRIPT_URI"]."all", "r"));
247
fpassthru(fopen(to_dir($_SERVER["SCRIPT_URI"])."/all", "r"));
248 248
?>
249 249
	</body>
250 250
</html>

Also available in: Unified diff