From 3645e61adb39533b056eb508de835aed0f24d520 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 30 Mar 2016 10:25:32 +0200 Subject: [PATCH] Use more braces to easily add more function calls --- index.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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; } -- 2.39.5