From: Roland Häder Date: Wed, 30 Mar 2016 08:25:32 +0000 (+0200) Subject: Use more braces to easily add more function calls X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3645e61adb39533b056eb508de835aed0f24d520;p=simple-upload.git Use more braces to easily add more function calls --- diff --git a/index.php b/index.php index e32486d..02f1f0f 100644 --- a/index.php +++ b/index.php @@ -243,8 +243,9 @@ $file_array = diverseArray($_FILES['file']); foreach ($file_array as $file_data) uploadFile($file_data); - } else + } else { uploadFile($_FILES['file']); + } exit; } @@ -262,15 +263,19 @@ global $data; $file_array = array(); + $dh = opendir($dir); - while ($filename = readdir($dh)) { - $fqfn = $dir . DIRECTORY_SEPARATOR . $filename; - if (isReadableFile($fqfn) && !in_array($filename, $data['ignores'])) - $file_array[filemtime($fqfn)] = $filename; - } + + while ($filename = readdir($dh)) { + $fqfn = $dir . DIRECTORY_SEPARATOR . $filename; + if (isReadableFile($fqfn) && !in_array($filename, $data['ignores'])) + $file_array[filemtime($fqfn)] = $filename; + } ksort($file_array); + $file_array = array_reverse($file_array, true); + return $file_array; }