# HG changeset patch # User edogawaconan # Date 1414636751 -32400 # Node ID 69b2c15cadfb74de137fc2eabd2a5a2ef51ceafa # Parent f9588ccb7a4299ecd2edd931a896e130acc82bc9 Better(?) way to check DL_DIR variable. diff -r f9588ccb7a42 -r 69b2c15cadfb index.php --- a/index.php Thu Oct 23 21:50:52 2014 +0900 +++ b/index.php Thu Oct 30 11:39:11 2014 +0900 @@ -12,8 +12,7 @@ $uri = urldecode($uri); // $dir: filesystem path - $dir = $_SERVER["DL_DIR"]; - if ($dir === null || $dir === "") { $dir = $_SERVER["DOCUMENT_ROOT"] . $uri; } + $dir = isset($_SERVER["DL_DIR"]) ? $_SERVER["DL_DIR"] : $_SERVER["DOCUMENT_ROOT"] . $uri; if (realpath($dir) === false) { header("HTTP/1.0 404 Not Found");