Jelajahi Sumber

[ZF-9320] Zend_Validate_File_MimeType:

- added a potential rework for a finfo bug

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22832 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 15 tahun lalu
induk
melakukan
8edffbe0e5
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      library/Zend/Validate/File/MimeType.php

+ 1 - 1
library/Zend/Validate/File/MimeType.php

@@ -191,7 +191,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
             $this->_magicfile = null;
             $this->_magicfile = null;
             require_once 'Zend/Validate/Exception.php';
             require_once 'Zend/Validate/Exception.php';
             throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
             throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
-        } else if (!is_readable($file)) {
+        } else if (!is_file($file) || !is_readable($file)) {
             require_once 'Zend/Validate/Exception.php';
             require_once 'Zend/Validate/Exception.php';
             throw new Zend_Validate_Exception('The given magicfile can not be read');
             throw new Zend_Validate_Exception('The given magicfile can not be read');
         } else {
         } else {