Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.0.2
-
Fix Version/s: None
-
Component/s: Zend_Filter_Input
-
Labels:None
Description
The value of ALLOW_EMPTY is not checked if there are mutliple fields to be validated.
require_once 'Zend/Filter/Input.php';
require_once 'Zend/Validate/Abstract.php';
class Zend_Validate_AlwaysFails extends Zend_Validate_Abstract {
public function isValid($values) {
return false;
}
}
$fails = new Zend_Validate_AlwaysFails();
$input = new Zend_Filter_Input(
array(),
array(
'test' => array(
$fails,
'allowEmpty' => true
'fields' => array('one', 'two')
)
),
array(
'one' => '',
'two' => ''
)
);
var_dump($input->isValid());
This should return true, but returns false because allow empty is ignored.
Attachments
Issue Links
| This issue duplicates: | ||||
| ZF-1859 | allowEmpty = false is ineffective if input rule has multiple fields |
|
|
|
Simple patch I whipped up to fix the problem.