From 117c8013d25ae8192531f0febcd993ef43b7b9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Jacquin?= Date: Tue, 18 Apr 2017 23:02:11 +0200 Subject: [PATCH 1/2] Option to hide exntensions into list added --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index fb5544c..9b6bb70 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,8 @@ $allow_direct_link = true; // Set to false to only allow downloads and not direc $disallowed_extensions = ['php']; // must be an array. +$hidden_extensions = ['php']; // must be an array. + $PASSWORD = ''; // Set the password, to access the file manager... (optional) if($PASSWORD) { @@ -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[] = [ From 3aa0897b44d9dfbefa40e7adb29638fa309fccaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Jacquin?= Date: Wed, 19 Apr 2017 08:57:36 +0200 Subject: [PATCH 2/2] Hidden/Disallowed extensions comments added --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 9b6bb70..969e37e 100644 --- a/index.php +++ b/index.php @@ -15,9 +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. +$hidden_extensions = ['php']; // must be an array. Extensions hidden in directory index $PASSWORD = ''; // Set the password, to access the file manager... (optional)