Mercurial > dirlist-php
diff index.php @ 51:29543401ef18
Ignore nonexisting files.
author | nanaya <me@myconan.net> |
---|---|
date | Mon, 24 Aug 2015 21:20:27 +0900 |
parents | 5a4c9efd99fc |
children | f48a4fbb9cf9 |
line wrap: on
line diff
--- a/index.php Mon Aug 24 21:13:56 2015 +0900 +++ b/index.php Mon Aug 24 21:20:27 2015 +0900 @@ -99,7 +99,10 @@ } foreach($files as $file) { - $file_stat = @stat($dir . "/". $file); + $file_path = $dir."/".$file; + + if (!file_exists($file_path)) { continue; } + $file_stat = stat($file_path); $file_rows .= "<tr>"; $file_rows .= "<td>". $list_file_prefix . link_to($file . $file_suffix, $file . $file_suffix)."</td>";