|
@@ -295,8 +295,6 @@ function getFileView($path) {
|
|
|
function isImage($filename) {
|
|
|
$types = '.gif|.jpeg|.png|.bmp'; //定义检查的图片类型
|
|
|
try {
|
|
|
- if (!$filename)
|
|
|
- return false;
|
|
|
$info = getimagesize($filename);
|
|
|
if ($info && stripos($types, image_type_to_extension($info['2'])) !== false) {
|
|
|
return true;
|
|
@@ -307,7 +305,7 @@ function isImage($filename) {
|
|
|
$types = "gif|jpg|jpeg|png|bmp";
|
|
|
$pathinfo = pathinfo($filename);
|
|
|
$ext = $pathinfo["extension"];
|
|
|
- if ($pathinfo && stripos($types, $ext) !== false) {
|
|
|
+ if ($pathinfo && $ext && stripos($types, $ext) !== false) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|