sugangqiang 2 жил өмнө
parent
commit
13f159ae6e
1 өөрчлөгдсөн 1 нэмэгдсэн , 3 устгасан
  1. 1 3
      app/common.php

+ 1 - 3
app/common.php

@@ -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;