Zend Framework

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

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.10.1
  • Component/s: Zend_File_Transfer
  • Labels:
    None

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.

Issue Links

Activity

Hide
Ramon Henrique Ornelas added a comment -

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

Show
Ramon Henrique Ornelas added a comment - Reported in ZF-9068. Fixed by @thomas in r20911.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: