summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-02-15 21:42:22 +0100
committerAndrey Andreev <narf@bofh.bg>2013-02-15 21:42:22 +0100
commit99ba3a26973848604719db08bbcafbfa82ca087f (patch)
tree93812df2ecb34df06e244109911e965974e624f9
parenta107a0fd79d0ee5f6292138a76398ed390041710 (diff)
Fix #2247
-rw-r--r--system/helpers/form_helper.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index f343b6c71..d6e3e85fa 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -228,13 +228,10 @@ if ( ! function_exists('form_upload'))
*/
function form_upload($data = '', $value = '', $extra = '')
{
- if ( ! is_array($data))
- {
- $data = array('name' => $data);
- }
-
+ $default = array('type' => 'file', 'name' => '');
+ is_array($data) OR $data = array('name' => $data);
$data['type'] = 'file';
- return form_input($data, $value, $extra);
+ return '<input '._parse_form_attributes($data, $defaults).$extra." />\n";
}
}