]> git.lizzy.rs Git - dirlistozxa.git/commitdiff
Hide all files and folders that begin with `.`
authorROllerozxa <rollerozxa@voxelmanip.se>
Sat, 29 Apr 2023 19:36:36 +0000 (21:36 +0200)
committerROllerozxa <rollerozxa@voxelmanip.se>
Sat, 29 Apr 2023 19:36:36 +0000 (21:36 +0200)
dirlistozxa.php

index 7654e8f0b5fec8776aa9a3245fb88b2a4f0e2436..eff24698b0be349ea63e4100b30d2c1b3bde3588 100644 (file)
 
 // List of filenames (and folder names) that should be ignored.
 $ignore_file_list = [
-       '.htaccess', '.htpasswd',       // Apache junk files
-       'Thumbs.db', '.DS_Store',       // OS junk files
-       'index.php', 'index.html',      // Potential other index files
-       '.git', 'vendor',                       // Dev
-       'dirlistozxa.php', '.dirlistozxa', '.thumbs', 'gen-thumbs' // dirlistozxa
+       'dirlistozxa.php', 'gen-thumbs' // dirlistozxa
 ];
 
 // ================
@@ -80,7 +76,7 @@ function build_blocks($items) {
        $objects = [ 'directories' => [], 'files' => [] ];
 
        foreach ($items as $item) {
-               if ($item == '..' || $item == '.' || in_array($item, $ignore_file_list)) continue;
+               if (in_array($item, $ignore_file_list) || str_starts_with($item, '.')) continue;
 
                if (is_dir($path.$item))
                        $objects['directories'][$item] = $item;