Skip to content

Commit

Permalink
Don't show partially uploaded files.
Browse files Browse the repository at this point in the history
  • Loading branch information
kduske committed Mar 25, 2016
1 parent 417e493 commit 576a100
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions www/downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ function list_downloads($dir, $exts) {
$files = array();
if (is_dir($dir) && $dir_handle = opendir($dir)) {
while (($file = readdir($dir_handle)) !== false) {
if (!is_dir($file) && has_extension($file, $exts))
$files[filemtime($dir . '/' . $file)] = $file;
$mtime = filemtime($dir . '/' . $file);
if (!is_dir($file) && has_extension($file, $exts) && $mtime < (time() - 10))
$files[$mtime] = $file;
}
}
krsort($files);
Expand Down

0 comments on commit 576a100

Please sign in to comment.