diff --git a/index.php b/index.php
index 71d8297..0233231 100644
--- a/index.php
+++ b/index.php
@@ -93,21 +93,23 @@
';
echo '
';
- if ($dh = opendir($dir))
+ $files = glob($dir . '/*');
+ usort($files, function($a, $b)
{
- while (($file = readdir($dh)) !== false)
+ return filemtime($b) - filemtime($a);
+ });
+
+ foreach($files as $path)
+ {
+ if (!str_ends_with($path, '.del'))
{
- if (!str_ends_with($file, '.del') && $file != '.' && $file != '..')
- {
- $mod = date("F d Y H:i:s", filemtime($dir . '/' . $file));
- echo '