作者 邓超

修复扩展名bug

... ... @@ -50,11 +50,13 @@ class Attachment {
return $this->extension;
}
// 在 mime文件类型中查找
if(is_file('mime.types') && $this->getFileType()){
$type = file_get_contents('mime.types');
$type = explode("\r\n",$type);
$a = is_file(__DIR__.'/mime.types');
if($a && $this->getFileType()){
$type = file_get_contents(__DIR__.'/mime.types');
$type = explode("\n",$type);
foreach ($type as $item){
if(stripos($item,$this->getFileType())===0){
$item = str_replace("\t"," ",$item);
list($t,$e) = explode(' ',$item,2);
$e = trim($e);
if($e){
... ...