summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index d5607d957..76779646e 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -547,7 +547,13 @@ function form_builder($form_id, $form) {
if (!isset($form['#name'])) {
$name = array_shift($form['#parents']);
$form['#name'] = $name;
- if (count($form['#parents'])) {
+ if ($form['#type'] == 'file') {
+ // to make it easier to handle $_FILES in file.inc, we place all
+ // file fields in the 'files' array. Also, we do not support
+ // nested file names
+ $form['#name'] = 'files['. $form['#name'] .']';
+ }
+ elseif (count($form['#parents'])) {
$form['#name'] .= '['. implode('][', $form['#parents']) .']';
}
array_unshift($form['#parents'], $name);