Issues

ZF-4323: Incorrect Zend_Form_Element_File validating & API inconsistence

Issue Type: Bug Created: 2008-09-18T01:07:32.000+0000 Last Updated: 2008-10-10T14:41:47.000+0000 Status: Resolved Fix version(s): - 1.6.2 (13/Oct/08)

Reporter: ?ar?nas D. (sarunas.d) Assignee: Thomas Weidner (thomas) Tags: - Zend_File_Transfer

  • Zend_Form

Related issues: Attachments:

Description

Zend_Form_Element_File shows errors from other file element in when using multiple file upload fields.

UC: Form Elements: $A = new Zend_Form_Element_File('A'); $A->setLabel('A') ->addValidator(new Zend_Validate_File_Count(0, 1)) ->addValidator(new Zend_Validate_File_ImageSize());

    $B = new Zend_Form_Element_File('B');
    $B->setLabel('B')
      ->addValidator(new Zend_Validate_File_Count(0, 1));

Scenario: Upload not an image to File A field.

Result: Error in B field: File 'A' error, possible attack.

Fix: Zend_Form_Element_File::isValid line: 275 if($adapter->receive($this->getName())) { return true; }

API inconsistency: Zend_Form_Element_File::hasErrors() returns false, but getErrors() returns array with errors.

Comments

Posted by Thomas Weidner (thomas) on 2008-09-19T14:59:39.000+0000

Both problem are fixed latest with r11446

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts