From: Roland Häder Date: Tue, 29 Mar 2016 13:27:56 +0000 (+0200) Subject: Renamed function as it doesn't list any files but creates an array. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=69cbc96f1e52bf14a6aea7e144a17a0eb6163468;p=simple-upload.git Renamed function as it doesn't list any files but creates an array. --- diff --git a/index.php b/index.php index 9429e6f..ee4e6a8 100644 --- a/index.php +++ b/index.php @@ -250,10 +250,10 @@ } // List files in a given directory, excluding certain files - function listFiles ($dir, $exclude) { + function createArrayFromPath ($dir, $exclude) { $file_array = array(); $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { + while ($filename = readdir($dh)) { $fqfn = $dir . DIRECTORY_SEPARATOR . $filename; if (is_file($fqfn) && !in_array($filename, $exclude)) $file_array[filemtime($fqfn)] = $filename; @@ -277,13 +277,13 @@ // Only read files if the feature is enabled if ($settings['listfiles']) { - $file_array = listFiles($data['uploaddir'], $data['ignores']); + $file_array = createArrayFromPath($data['uploaddir'], $data['ignores']); // Removing old files if ($settings['remove_old_files']) removeOldFiles($data['uploaddir']); - $file_array = listFiles($data['uploaddir'], $data['ignores']); + $file_array = createArrayFromPath($data['uploaddir'], $data['ignores']); } ?>