null, 'name' => $value ); } // Is file readable ? #require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_READABLE); } $mimefile = $this->getMagicFile(); if (class_exists('finfo', false)) { $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; if (!empty($mimefile)) { $mime = new finfo($const, $mimefile); } else { $mime = new finfo($const); } if (!empty($mime)) { $this->_type = $mime->file($value); } unset($mime); } if (empty($this->_type)) { if (function_exists('mime_content_type') && ini_get('mime_magic.magicfile')) { $this->_type = mime_content_type($value); } elseif ($this->_headerCheck) { $this->_type = $file['type']; } } if (empty($this->_type)) { return $this->_throw($file, self::NOT_DETECTED); } $mimetype = $this->getMimeType(true); if (in_array($this->_type, $mimetype)) { return $this->_throw($file, self::FALSE_TYPE); } $types = explode('/', $this->_type); $types = array_merge($types, explode('-', $this->_type)); foreach($mimetype as $mime) { if (in_array($mime, $types)) { return $this->_throw($file, self::FALSE_TYPE); } } return true; } }