mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
修正request类的file方法
This commit is contained in:
@@ -48,7 +48,7 @@ class File extends SplFileObject
|
||||
|
||||
/**
|
||||
* 设置上传信息
|
||||
* @param bool $info 上传文件信息
|
||||
* @param array $info 上传文件信息
|
||||
* @return $this
|
||||
*/
|
||||
public function setUploadInfo($info)
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
namespace think;
|
||||
|
||||
use think\Config;
|
||||
use think\Exception;
|
||||
use think\File;
|
||||
use think\Session;
|
||||
use think\Exception;
|
||||
|
||||
class Request
|
||||
{
|
||||
@@ -810,7 +810,7 @@ class Request
|
||||
if (empty($val['tmp_name'])) {
|
||||
continue;
|
||||
}
|
||||
$item[$key] = new File($val['tmp_name'])->setUploadInfo($val);
|
||||
$item[$key] = (new File($val['tmp_name']))->setUploadInfo($val);
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
@@ -818,7 +818,7 @@ class Request
|
||||
if ($array[$name] instanceof File) {
|
||||
return $array[$name];
|
||||
} elseif (!empty($array[$name]['tmp_name'])) {
|
||||
return new File($array[$name]['tmp_name'])->setUploadInfo($array[$name]);
|
||||
return (new File($array[$name]['tmp_name']))->setUploadInfo($array[$name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user