Merge pull request #47 from remyj38/master

Option to hide exntensions into list added
This commit is contained in:
John Campbell
2017-04-19 14:18:41 -04:00
committed by GitHub
+4 -2
View File
@@ -15,7 +15,9 @@ $allow_create_folder = true; // Set to false to disable folder creation
$allow_upload = true; // Set to true to allow upload files
$allow_direct_link = true; // Set to false to only allow downloads and not direct link
$disallowed_extensions = ['php']; // must be an array.
$disallowed_extensions = ['php']; // must be an array. Extensions disallowed to be uploaded
$hidden_extensions = ['php']; // must be an array. Extensions hidden in directory index
$PASSWORD = ''; // Set the password, to access the file manager... (optional)
@@ -59,7 +61,7 @@ if($_GET['do'] == 'list') {
$directory = $file;
$result = [];
$files = array_diff(scandir($directory), ['.','..']);
foreach($files as $entry) if($entry !== basename(__FILE__)) {
foreach($files as $entry) if($entry !== basename(__FILE__) && !in_array(strtolower(pathinfo($entry, PATHINFO_EXTENSION)), $hidden_extensions)) {
$i = $directory . '/' . $entry;
$stat = stat($i);
$result[] = [