|
楼主 |
发表于 2017-7-13 17:33:43
|
显示全部楼层
源码再网上看一点:
$ext = strtolower(ltrim($this->file_ext, '.'));
if ( ! in_array($ext, $this->allowed_types, TRUE))
{
return FALSE;
}
// Images get some additional checks
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png'), TRUE) && @getimagesize($this->file_temp) === FALSE)
{
return FALSE;
}
if ($ignore_mime === TRUE)
{
return TRUE;
}
if (isset($this->_mimes[$ext]))
{
return is_array($this->_mimes[$ext])
? in_array($this->file_type, $this->_mimes[$ext], TRUE)
: ($this->_mimes[$ext] === $this->file_type);
}
我觉得呢,
$ext = strtolower(ltrim($this->file_ext, '.'));
应该拿真实的扩展
$ext = strtolower(ltrim($this->file_type, '.')); |
|