summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar steering72532026-07-10 07:04:43 +0000
committerGravatar steering72532026-07-10 07:04:43 +0000
commitd0638eb3cca8c3ce43972f2a9813a754f25d6cfe (patch)
tree175148730d7e58b5d8217934fecd2203e1e59bc2
parentsilence some warnings and let some safe comparisons be loose (diff)
downloadhostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.tar.gz
hostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.tar.bz2
hostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.zip
rework remap_files a bit
-rw-r--r--upload.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/upload.php b/upload.php
index 95d1a66..d643d0a 100644
--- a/upload.php
+++ b/upload.php
@@ -139,13 +139,13 @@ function remap_files() {
$files[$input_name] = array();
foreach (array_keys($_FILES[$input_name]) as $file_info_key) {
if (is_array($_FILES[$input_name][$file_info_key])) {
- foreach ($_FILES[$input_name][$file_info_key] as $i => $v) {
- if (!isset($files[$input_name][$i])) $files[$input_name][$i] = array();
- $files[$input_name][$i][$file_info_key] = $v;
- }
+ $target = $_FILES[$input_name][$file_info_key];
} else {
- if (!isset($files[$input_name][0])) $files[$input_name][0] = array();
- $files[$input_name][0][$file_info_key] = $_FILES[$input_name][$file_info_key];
+ $target = array(0 => $_FILES[$input_name][$file_info_key]);
+ }
+ foreach ($target as $i => $v) {
+ if (!isset($files[$input_name][$i])) $files[$input_name][$i] = array();
+ $files[$input_name][$i][$file_info_key] = $v;
}
}
}