mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Issue 2250: Add to context multiple file upload support
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11041 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
851f7a9710
commit
ddbe72b5b1
1 changed files with 18 additions and 4 deletions
|
|
@ -907,10 +907,24 @@ class Context {
|
|||
|
||||
foreach($_FILES as $key => $val) {
|
||||
$tmp_name = $val['tmp_name'];
|
||||
if(!$tmp_name || !is_uploaded_file($tmp_name)) continue;
|
||||
$val['name'] = htmlspecialchars($val['name']);
|
||||
$this->set($key, $val, true);
|
||||
$this->is_uploaded = true;
|
||||
if(!is_array($tmp_name)){
|
||||
if(!$tmp_name || !is_uploaded_file($tmp_name)) continue;
|
||||
$val['name'] = htmlspecialchars($val['name']);
|
||||
$this->set($key, $val, true);
|
||||
$this->is_uploaded = true;
|
||||
}else {
|
||||
for($i=0;$i< count($tmp_name);$i++){
|
||||
if($val['size'][$i] > 0){
|
||||
$file['name']=$val['name'][$i];
|
||||
$file['type']=$val['type'][$i];
|
||||
$file['tmp_name']=$val['tmp_name'][$i];
|
||||
$file['error']=$val['error'][$i];
|
||||
$file['size']=$val['size'][$i];
|
||||
$files[] = $file;
|
||||
}
|
||||
}
|
||||
$this->set($key, $files, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue