Issues

ZF-9107: _detectMimeType() called from Zend_File_Transfer_Http::__construct() throws Warning on finfo() when magicFile is set as an option

Description

When calling Zend_File_Transfer_Http::__construct(), finfo() warning errors will be thrown in Zend_File_Transfer_Abstract::_detectMimeType() if finfo() cannot automatically detect the location of the magic database file.

The problems are two-fold:

1) Zend_File_Transfer_Abstract::_detectMimeType() does a check on $magicFile but the variable is never declared so it will always fail. This should implement a more valid check on a method like getMagicFile() or something.

2) Zend_File_Transfer_Http::__construct() calls Zend_File_Transfer::_prepareFiles() which is the method that actually calls _detectMimeType() before it calls Zend_File_Transfer_Abstract::setOptions() so the file can never be set prior to the _detectMimeType() method being called the first time.

Comments

Reported in ZF-9068. Fixed by @thomas in r20911.