Mercurial > dirlist-php
changeset 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 | e4f534198385 |
children | 73833d29dbad |
files | index.php |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
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) {