diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-31 07:30:49 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-31 07:30:49 +0000 |
commit | e3bf577eb033e85727235385b0ba35638942807b (patch) | |
tree | d17bb40e28a8f0513005b583d5ea8c6ef16c5e8e /includes/form.inc | |
parent | f6cdee1e14b12d43a4bb7bb643fe98358f5bf281 (diff) | |
download | brdo-e3bf577eb033e85727235385b0ba35638942807b.tar.gz brdo-e3bf577eb033e85727235385b0ba35638942807b.tar.bz2 |
#80574 by Steven and chx. Fix file uploads.
Diffstat (limited to 'includes/form.inc')
-rw-r--r-- | includes/form.inc | 8 |
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); |