comparison index.php @ 5:b84ce3ef4c9d

Fix behaviour difference between version.
author edogawaconan <me@myconan.net>
date Tue, 21 Oct 2014 21:41:49 +0900
parents 7812af1c23ae
children 8df269a2efd8
comparison
equal deleted inserted replaced
4:7812af1c23ae 5:b84ce3ef4c9d
9 $path = substr($path, 0, $query_string_start); 9 $path = substr($path, 0, $query_string_start);
10 } 10 }
11 $path = urldecode($path); 11 $path = urldecode($path);
12 12
13 $prefix = $_SERVER["DL_PREFIX"]; 13 $prefix = $_SERVER["DL_PREFIX"];
14 14 if ($prefix === null) { $prefix = ""; }
15 $path = substr($path, strlen(utf8_decode($prefix))); 15
16 $path = substr($path, strlen($prefix));
16 if ($path === false) { $path = "/"; } 17 if ($path === false) { $path = "/"; }
17 18
18 // root of directory listing. 19 // root of directory listing.
19 $root = $_SERVER["DL_ROOT"]; 20 $root = $_SERVER["DL_ROOT"];
20 if ($root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; } 21 if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; }
21 22
22 // current directory being listed. 23 // current directory being listed.
23 $current_dir = $root . $path; 24 $current_dir = $root . $path;
24 25
25 if (realpath($root . $path) === false) { 26 if (realpath($root . $path) === false) {