Index: tests/Zend/Filter/InputTest.php =================================================================== --- tests/Zend/Filter/InputTest.php (revision 24388) +++ tests/Zend/Filter/InputTest.php (working copy) @@ -81,6 +81,27 @@ /** * + * Empty arrays should be considered as not valid with NotEmpty. + * + */ + function testNotEmptyValidatorWithEmptyArray() + { + require_once 'Zend/Filter/Input.php'; + + $validators = array( + 'test' => array() + ); + + $data = array( + 'test' => array() + ); + + $input = new Zend_Filter_Input(null, $validators, $data); + $this->assertFalse($input->isValid()); + } + + /** + * * If setAllowEmpty(true) is called, all fields are optional, but fields with * a NotEmpty validator attached to them, should contain a non empty value. * Index: library/Zend/Filter/Input.php =================================================================== --- library/Zend/Filter/Input.php (revision 24388) +++ library/Zend/Filter/Input.php (working copy) @@ -1056,7 +1056,7 @@ $field = reset($data); $failed = false; - if (!is_array($field)) { + if (!is_array($field) || empty($field)) { $field = array($field); }