Mercurial > dirlist-php
comparison index.php @ 6:8df269a2efd8
Remove unused variable.
| author | edogawaconan <me@myconan.net> |
|---|---|
| date | Tue, 21 Oct 2014 21:44:36 +0900 |
| parents | b84ce3ef4c9d |
| children | c4046c7e1f5a |
comparison
equal
deleted
inserted
replaced
| 5:b84ce3ef4c9d | 6:8df269a2efd8 |
|---|---|
| 17 if ($path === false) { $path = "/"; } | 17 if ($path === false) { $path = "/"; } |
| 18 | 18 |
| 19 // root of directory listing. | 19 // root of directory listing. |
| 20 $root = $_SERVER["DL_ROOT"]; | 20 $root = $_SERVER["DL_ROOT"]; |
| 21 if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; } | 21 if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; } |
| 22 | |
| 23 // current directory being listed. | |
| 24 $current_dir = $root . $path; | |
| 25 | 22 |
| 26 if (realpath($root . $path) === false) { | 23 if (realpath($root . $path) === false) { |
| 27 header("HTTP/1.0 404 Not Found"); | 24 header("HTTP/1.0 404 Not Found"); |
| 28 } elseif (substr($current_dir, -1) !== "/") { | 25 } elseif (substr($current_dir, -1) !== "/") { |
| 29 header("Location: " . $path . "/", false, 301); | 26 header("Location: " . $path . "/", false, 301); |
