Mercurial > dirlist-php
diff index.php @ 28:ce92f4d41714
Add support for displaying hidden files.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 30 Oct 2014 12:14:32 +0900 |
parents | aa3f0003fb41 |
children | c482f0db5c28 |
line wrap: on
line diff
--- a/index.php Thu Oct 30 12:05:35 2014 +0900 +++ b/index.php Thu Oct 30 12:14:32 2014 +0900 @@ -28,7 +28,8 @@ $files = array(); $dirs = array(); while (($file = readdir($dir_handle)) !== false) { - if (substr($file, 0, 1) === ".") { continue; } + if ($file === "." || $file === "..") { continue; } + elseif (!(isset($_SERVER["DL_SHOWALL"]) && $_SERVER["DL_SHOWALL"] === "1") && substr($file, 0, 1) === ".") { continue; } elseif (is_dir($dir . $file)) { $dirs[] = $file; } else { $files[] = $file; } }