Skip to content

Commit b396499

Browse files
committed
Update class.uploader.php
1 parent 218681b commit b396499

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/class.uploader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ private function initialize($field, $options){
9393
$this->field['Field_Name'] = array_search($field, $_FILES);
9494
$this->field['Field_Type'] = 'input';
9595

96+
if(!is_array($this->field['name'])){
97+
$this->field = array_merge($this->field, array("name" => array($this->field['name']), "tmp_name"=>array($this->field['tmp_name']), "type"=>array($this->field['type']), "error"=>array($this->field['error']), "size"=>array($this->field['size'])));
98+
}
99+
96100
foreach($this->field['name'] as $key=>$value){ if(empty($value)){ unset($this->field['name'][$key]); unset($this->field['type'][$key]); unset($this->field['tmp_name'][$key]); unset($this->field['error'][$key]); unset($this->field['size'][$key]); } }
97101

98102
$this->field['length'] = count($this->field['name']);
@@ -420,4 +424,4 @@ private function _onRemove(){
420424
return $this->options['onRemove'] && function_exists($this->options['onRemove']) ? $this->options['onRemove'](@$arguments[0], @$arguments[1]) : null;
421425
}
422426
}
423-
?>
427+
?>

0 commit comments

Comments
 (0)