ZF-123: Zend_Filter_Input doesn't check if requested key exists (TRAC#142)

Issue Type: Bug Created: 2006-06-21T22:35:56.000+0000 Last Updated: 2007-07-05T14:44:29.000+0000 Status: Closed Fix version(s): - 0.1.5 (11/Jul/06)

Reporter: Zend Framework (zend_framework) Assignee: Darby Felton (darby) Tags: - Zend_Filter

Related issues: Attachments: - zfi_zf-123.patch.txt


When we work in a STRICT mode and put a $_POST array to constructor and we have no longer access to those data then it is not possible to check if the key was send in request. When we work in a non-STRICT mode we could first check if the key was send (eg. if (array_key_exists('my_key', $_POST){...}) and then filter this data through Zend_Filter_Input but then we keep data in 2 copies ($_POST and Zend_Filter_Input::_source). I suggest checking if requested key exists in each method or adding new method eg. existsKey().


Posted by Zend Framework (zend_framework) on 2006-06-21T22:36:08.000+0000

06/14/06 17:47:39: Modified by gavin…

The new router (in version 0.1.4) will cleanly distinguish between:

?foo=bar ?foo= ?

Although not exactly the same issue, the final solution for both Zend_Controller_Action and Zend_Input_Filter should have consistent semantics. For example, null indicates parameter not available/given, an empty string indicates the parameter was supplied / is available, and a non-empty string would contain the value of the parameter.


* <a rel="nofollow" href="">;</a>
* #90 

06/14/06 18:15:43: Modified by gavin

We should be able to distinguish between the absense or presence of an input parameter.

If Zend_Input_Filter is altered, the rationale in the documentation might also need updating:…

Posted by Kevin McArthur (kevin) on 2006-06-29T17:01:58.000+0000

Patch to resolve most problems.

Adds the keyExists function as well as ensures that no notices are thrown in strict mode by using array_key_exists first.

Posted by Kevin McArthur (kevin) on 2006-06-29T17:04:05.000+0000

Patch attached. Would prefer this makes 0.1.4.

Posted by Kevin McArthur (kevin) on 2006-06-30T14:41:44.000+0000

Updated fix version/affects version as it may have gotten into scm too late to make the 0.1.4 rls. Original patch was submitted june 14. I dont have karma on this component so can't commit it if the patch is approved.

Posted by Jayson Minard (jayson) on 2006-07-05T06:52:09.000+0000

Check and apply patch

Posted by Darby Felton (darby) on 2006-07-05T13:22:09.000+0000

fixed by SVN revision 807

Posted by Jayson Minard (jayson) on 2006-07-11T11:54:38.000+0000

0.1.5 released

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.