Mercurial > dirlist-php
diff index.php @ 30:c482f0db5c28
Turns out "CONTEXT_DOCUMENT_ROOT" isn't enough.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 30 Oct 2014 13:03:28 +0900 |
parents | ce92f4d41714 |
children | 986aec12eb7f |
line wrap: on
line diff
--- a/index.php Thu Oct 30 12:29:39 2014 +0900 +++ b/index.php Thu Oct 30 13:03:28 2014 +0900 @@ -13,7 +13,10 @@ // $dir: filesystem path if (isset($_SERVER["DL_DIR"])) { $dir = $_SERVER["DL_DIR"]; } - elseif (isset($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $dir = $_SERVER["CONTEXT_DOCUMENT_ROOT"]; } + elseif (isset($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $dir = $_SERVER["CONTEXT_DOCUMENT_ROOT"]; + $dir .= substr($uri, strlen($_SERVER["CONTEXT_PREFIX"])); + } else { $dir = $_SERVER["DOCUMENT_ROOT"] . $uri; } if (realpath($dir) === false) {