ZF-9701: Zend_Validate_File_MimeType fails on Windows

Issue Type: Bug Created: 2010-04-18T08:23:03.000+0000 Last Updated: 2010-04-18T09:47:35.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: Micha? Bachowski (mib) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments:


When using Zend_Validate_File_MimeType on Windows I encountered an error:

"finfo_file() expects parameter 1 to be resource, null given (E:\php\utilities\library\Zend\Validate\File\MimeType.php:344)"

It causes validator to fail on completely valid image. That`s because $this->_finfo is "null" instead of "false":

<pre class="highlight">
            if ($this->_finfo === false) {
                $this->_finfo = @finfo_open($const);

            if ($this->_finfo !== false) {
                $this->_type = finfo_file($this->_finfo, $value);

When I change condition to "if ($this->_finfo == false)" - everyting works just fine.

ZF: 1.10.3 PHP: 5.3.0 OS: Windows 7


Posted by Thomas Weidner (thomas) on 2010-04-18T09:47:33.000+0000

Already fixed in trunk

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.