diff options
| author | 2026-07-10 07:04:43 +0000 | |
|---|---|---|
| committer | 2026-07-10 07:04:43 +0000 | |
| commit | d0638eb3cca8c3ce43972f2a9813a754f25d6cfe (patch) | |
| tree | 175148730d7e58b5d8217934fecd2203e1e59bc2 | |
| parent | silence some warnings and let some safe comparisons be loose (diff) | |
| download | hostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.tar.gz hostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.tar.bz2 hostfiles-d0638eb3cca8c3ce43972f2a9813a754f25d6cfe.zip | |
rework remap_files a bit
| -rw-r--r-- | upload.php | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } } } |
