|
@@ -128,9 +128,6 @@ class Save
|
|
|
finfo_close($finfo);
|
|
|
$temp = explode(';', $code);
|
|
|
$ext = $this->getExtByMine($temp[0]);
|
|
|
- if (!$ext) {
|
|
|
- $ext = $this->getExtByByte($source);
|
|
|
- }
|
|
|
$size = filesize($source);
|
|
|
$method = 'getimagesize';
|
|
|
}
|
|
@@ -141,6 +138,9 @@ class Save
|
|
|
if (!$source) {
|
|
|
Dever::error('源文件不存在');
|
|
|
}
|
|
|
+ if (!$ext) {
|
|
|
+ $ext = $this->getExtByByte($source);
|
|
|
+ }
|
|
|
if (!$ext && $default_ext) {
|
|
|
$ext = $default_ext;
|
|
|
}
|
|
@@ -319,6 +319,9 @@ class Save
|
|
|
|
|
|
protected function getExtByMine($mine, $flip = false, $result = false)
|
|
|
{
|
|
|
+ if (!$mine) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
$config = array
|
|
|
(
|
|
|
'application/envoy' => 'evy',
|
|
@@ -476,9 +479,6 @@ class Save
|
|
|
if ($flip) {
|
|
|
$config = array_flip($config);
|
|
|
}
|
|
|
- if (!$mine) {
|
|
|
- return $config;
|
|
|
- }
|
|
|
$mine = trim($mine);
|
|
|
if (isset($config[$mine])) {
|
|
|
return $config[$mine];
|