Zend Framework

MimeType fails to validate more than one files from form

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.10.3
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Validate_File
  • Labels:
    None

Description

1. I transmit two files from the form:
<input type="file" name="files[0]" id="files[0]" />
<input type="file" name="files[1]" id="files[1]" />

2. FileInfo gets an array of two elements:
array(2) {
["files_0_"] => array(11) { ["name"] => ... ["type"] => ... }
["files_1_"] => array(11) { ["name"] => ... ["type"] => ... } }
}

3. Validator Zend_Validate_File_MimeType fail to validate second file with the message:
Message: No property exists by the name '_finfo'

4. The reason is the 'unset($this->_finfo);' operator in line 347 of isValid() function.
Class validates first file, then kills '_finfo' variable and fails to pass second.
If I comment this line, validation pass both files.

And another thing about this issue...
For each pass code above the line 347 reopens mimefile. Why don't to use one created in constructor?

Activity

Hide
Thomas Weidner added a comment -

Please give some code to reproduce your problem.

There is no unset within Zend_Validate_File_MimeType on that lines or near them. isValid is unset-free.

Show
Thomas Weidner added a comment - Please give some code to reproduce your problem. There is no unset within Zend_Validate_File_MimeType on that lines or near them. isValid is unset-free.
Hide
Thomas Weidner added a comment -

Closing as duplicate.
Issue seems to be fixed by another issue as there is no unset()

Show
Thomas Weidner added a comment - Closing as duplicate. Issue seems to be fixed by another issue as there is no unset()

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: