mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +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
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setUploadInfo($info)
|
public function setUploadInfo($info)
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
namespace think;
|
namespace think;
|
||||||
|
|
||||||
use think\Config;
|
use think\Config;
|
||||||
|
use think\Exception;
|
||||||
use think\File;
|
use think\File;
|
||||||
use think\Session;
|
use think\Session;
|
||||||
use think\Exception;
|
|
||||||
|
|
||||||
class Request
|
class Request
|
||||||
{
|
{
|
||||||
@@ -810,7 +810,7 @@ class Request
|
|||||||
if (empty($val['tmp_name'])) {
|
if (empty($val['tmp_name'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$item[$key] = new File($val['tmp_name'])->setUploadInfo($val);
|
$item[$key] = (new File($val['tmp_name']))->setUploadInfo($val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
@@ -818,7 +818,7 @@ class Request
|
|||||||
if ($array[$name] instanceof File) {
|
if ($array[$name] instanceof File) {
|
||||||
return $array[$name];
|
return $array[$name];
|
||||||
} elseif (!empty($array[$name]['tmp_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