diff 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
line wrap: on
line diff
--- a/index.php	Tue Oct 21 21:31:38 2014 +0900
+++ b/index.php	Tue Oct 21 21:41:49 2014 +0900
@@ -11,13 +11,14 @@
   $path = urldecode($path);
 
   $prefix = $_SERVER["DL_PREFIX"];
+  if ($prefix === null) { $prefix = ""; }
 
-  $path = substr($path, strlen(utf8_decode($prefix)));
+  $path = substr($path, strlen($prefix));
   if ($path === false) { $path = "/"; }
 
   // root of directory listing.
   $root = $_SERVER["DL_ROOT"];
-  if ($root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; }
+  if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; }
 
   // current directory being listed.
   $current_dir = $root . $path;