php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57005 Filter type not reset when walking input_get_args() array
Submitted: 2006-05-08 21:40 UTC Modified: 2006-05-09 07:15 UTC
From: dave@php.net Assigned: pajoye (profile)
Status: Closed Package: filter (PECL)
PHP Version: HEAD CVS-2006-05-08 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 + 24 = ?
Subscribe to this entry?

 
 [2006-05-08 21:40 UTC] dave@php.net
Description:
------------
The filter variable is not reset properly (filter_flags is, however). This results in the possibility of a variable using the filter type of the previous variable.

Reproduce code:
---------------
Using http://pecl.php.net/~pierre/filter_input_get_args_example.phps, and removing 'component's filter type:

$args = array(
    'product_id'    => FILTER_SANITIZE_ENCODED,
    'component'     => array('flags'    => FILTER_FLAG_ARRAY, 
                             'options'    => array("min_range"=>1, "max_range"=>10)
                        ),
);

Will result in the FILTER_SANITIZE_ENCODED filter being applied to 'component' instead of FILTER_DEFAULT.

Solution:

Add filter = FILTER_DEFAULT; above filter_flags = 0;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-09 02:06 UTC] derick@php.net
One for you Pierre (you broke it, you fix it ;-) )
 [2006-05-09 07:15 UTC] pierre dot php at gmail dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC