ZF-1859: allowEmpty = false is ineffective if input rule has multiple fields

Issue Type: Bug Created: 2007-08-16T14:49:45.000+0000 Last Updated: 2009-08-25T13:15:14.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Bill Karwin (bkarwin) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter_Input

Related issues: - ZF-2089



Issue reported by Jim Scherer.

Below is code to demonstrate the failure:

<pre class="highlight">

require_once 'Zend/Loader.php';

$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";

echo "\nvalidators =\n";

// echo "\ninput object =\n";
// echo var_dump($input);

echo "\nempty(data[empty]) =\n";

echo "\nempty(data[notempty]) =\n";


Posted by Bill Karwin (bkarwin) on 2007-08-16T14:50:53.000+0000

Confirmed that isValid() returns true, which is wrong for the example case above.

Posted by Bill Karwin (bkarwin) on 2007-10-17T15:28:44.000+0000

Changing to 'Unassigned'

Posted by Wil Sinclair (wil) on 2008-03-21T17:05:33.000+0000

This issue should have been fixed for the 1.5 release.

Posted by Wil Sinclair (wil) on 2008-04-18T13:11:51.000+0000

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Posted by Wil Sinclair (wil) on 2008-04-18T16:58:29.000+0000

Please evaluate and categorize/assign as necessary.

Posted by Benjamin Eberlei (beberlei) on 2009-01-07T15:49:58.000+0000

I will spend some time on it later this week.

Posted by Thomas Weidner (thomas) on 2009-08-25T13:15:14.000+0000

Running the above code on actual trunk I get the expected and wished result. Closing this issue as fixed for the next release as I'm unsure when it was really fixed.

Have you found an issue?

See the Overview section for more details.


© 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.