ZF-7471: Zend_Filter_Input::DEFAULT_VALUE setting can't be array

Issue Type: Bug Created: 2009-08-04T06:35:38.000+0000 Last Updated: 2012-11-20T20:53:21.000+0000 Status: Closed Fix version(s): Reporter: Zoran Lazic (zoki) Assignee: None Tags: - Zend_Filter_Input

Related issues: - ZF-6763



When defining field rules for Zend_Filter_Input, default value cannot be array.

<pre class="literal"> 
    $data = array(); // post no data
    $fields = array(
            'names' => array(
                Zend_Filter_Input::DEFAULT_VALUE => array(1, 2, 3),
        $filters = array();

        $zfi = new Zend_Filter_Input($filters, $fields, $data);
        var_dump($zfi->getUnescaped()); // array(1) { ["names"]=>  int(1) }
        // names should be array(1, 2, 3)

In Zend/Filter/Input.php there is still /** @todo according to this code default value can't be an array. It has to be reviewed */. Maybe it's time to get this fixed.


Posted by Rob Allen (rob) on 2012-11-20T20:53:21.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

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.