|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41110 Filter extension doesn't allow GET/POST array parameters
Submitted: 2007-04-17 02:51 UTC Modified: 2007-04-17 06:44 UTC
From: mauroi at digbang dot com Assigned: pajoye (profile)
Status: Not a bug Package: Filter related
PHP Version: 5.2.1 OS: Linux & Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mauroi at digbang dot com
New email:
PHP Version: OS:


 [2007-04-17 02:51 UTC] mauroi at digbang dot com
I'm trying to use an old way of sending arrays between pages in PHP with the new filter extension. With normal superglobals if you append '[]' after a parameter's name, you get an array with one element for each aparence.

results in an array with two positions in $_GET['a'].

I'm not being able to emulate this behavior with the filter extension.

Reproduce code:
var_dump(filter_input(INPUT_GET, 'a', FILTER_DEFAULT))

Expected result:
array(2) {
  string(1) "1"
  string(1) "2"
array(2) {
  string(1) "1"
  string(1) "2"

Actual result:
array(2) {
  string(1) "1"
  string(1) "2"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-17 06:44 UTC]
Use the FILTER_FORCE_ARRAY array. It allows array as input and always returns an array (skipping a pointless if (is_array($a)) test).

Or use FILTER_REQUIRE_ARRAY if you expect an array.

No bug > bogus.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Nov 29 07:01:28 2023 UTC