From: Roland Häder Date: Tue, 29 Mar 2016 13:10:18 +0000 (+0200) Subject: Only read files for listing them if the feature is enabled. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=afca84b91a5a6ba613ea1ceea9e9da52e856fddc;p=simple-upload.git Only read files for listing them if the feature is enabled. --- diff --git a/index.php b/index.php index 7ecb927..0746448 100644 --- a/index.php +++ b/index.php @@ -261,14 +261,16 @@ } } - $file_array = listFiles($data['uploaddir'], $data['ignores']); + // Only read files if the feature is enabled + if ($settings['listfiles']) { + $file_array = listFiles($data['uploaddir'], $data['ignores']); - // Removing old files - if ($settings['remove_old_files']) - removeOldFiles($data['uploaddir']); + // Removing old files + if ($settings['remove_old_files']) + removeOldFiles($data['uploaddir']); - $file_array = listFiles($data['uploaddir'], $data['ignores']); - //die(print_r($file_array, TRUE)); + $file_array = listFiles($data['uploaddir'], $data['ignores']); + } ?>