Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.1
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Filter_Input
-
Labels:None
-
Fix Version Priority:Should Have
Description
Issue reported by Jim Scherer.
Below is code to demonstrate the failure:
<?php
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$filters = array( );
$validators = array(
'test' => array(
'allowEmpty' => false,
'fields' => array( 'empty', 'notempty' )
)
);
$data = array(
'empty' => '',
'notempty' => 'not empty'
);
$input = new Zend_Filter_Input( $filters, $validators, $data );
// expect input to be invalid
echo "\ninput->isValid =\n";
var_dump($input->isValid());
echo "\nvalidators =\n";
var_dump($validators);
// echo "\ninput object =\n";
// echo var_dump($input);
echo "\nempty(data[empty]) =\n";
var_dump(empty($data['empty']));
echo "\nempty(data[notempty]) =\n";
var_dump(empty($data['notempty']));
Issue Links
| This issue is duplicated by: | ||||
| ZF-2089 | ALLOW_EMPTY ignored when validating multiple fields |
|
|
|
Confirmed that isValid() returns true, which is wrong for the example case above.