Zend Framework

Zend_Filter_Input doesn't check if requested key exists (TRAC#142)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.1.4
  • Fix Version/s: 0.1.5
  • Component/s: Zend_Filter
  • Labels:
    None

Description

http://framework.zend.com/developer/ticket/142

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().

Activity

Hide
Zend Framework added a comment -

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

http://framework.zend.com/developer/browser/trunk/incubator/library/Zend/Controller

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.

References:

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: http://framework.zend.com/manual/en/zend.inputfilter.html

Show
Zend Framework added a comment - 06/14/06 17:47:39: Modified by gavin http://framework.zend.com/developer/browser/trunk/incubator/library/Zend/Controller 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. References: 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: http://framework.zend.com/manual/en/zend.inputfilter.html
Hide
Kevin McArthur added a comment -

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.

Show
Kevin McArthur added a comment - 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.
Hide
Kevin McArthur added a comment -

Patch attached. Would prefer this makes 0.1.4.

Show
Kevin McArthur added a comment - Patch attached. Would prefer this makes 0.1.4.
Hide
Kevin McArthur added a comment -

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.

Show
Kevin McArthur added a comment - 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.
Hide
Jayson Minard added a comment -

Check and apply patch

Show
Jayson Minard added a comment - Check and apply patch
Hide
Darby Felton added a comment -

fixed by SVN revision 807

Show
Darby Felton added a comment - fixed by SVN revision 807
Hide
Jayson Minard added a comment -

0.1.5 released

Show
Jayson Minard added a comment - 0.1.5 released

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: