正在显示
1 个修改的文件
包含
5 行增加
和
3 行删除
| @@ -50,11 +50,13 @@ class Attachment { | @@ -50,11 +50,13 @@ class Attachment { | ||
| 50 | return $this->extension; | 50 | return $this->extension; |
| 51 | } | 51 | } |
| 52 | // 在 mime文件类型中查找 | 52 | // 在 mime文件类型中查找 |
| 53 | - if(is_file('mime.types') && $this->getFileType()){ | ||
| 54 | - $type = file_get_contents('mime.types'); | ||
| 55 | - $type = explode("\r\n",$type); | 53 | + $a = is_file(__DIR__.'/mime.types'); |
| 54 | + if($a && $this->getFileType()){ | ||
| 55 | + $type = file_get_contents(__DIR__.'/mime.types'); | ||
| 56 | + $type = explode("\n",$type); | ||
| 56 | foreach ($type as $item){ | 57 | foreach ($type as $item){ |
| 57 | if(stripos($item,$this->getFileType())===0){ | 58 | if(stripos($item,$this->getFileType())===0){ |
| 59 | + $item = str_replace("\t"," ",$item); | ||
| 58 | list($t,$e) = explode(' ',$item,2); | 60 | list($t,$e) = explode(' ',$item,2); |
| 59 | $e = trim($e); | 61 | $e = trim($e); |
| 60 | if($e){ | 62 | if($e){ |
-
请 注册 或 登录 后发表评论