php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43625 square brackets in form input name are 'dropped'
Submitted: 2007-12-18 15:26 UTC Modified: 2008-02-01 22:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: php-qa at sebastianmendel dot de Assigned:
Status: Not a bug Package: Apache related
PHP Version: 5.3CVS-2007-12-18 (CVS) OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php-qa at sebastianmendel dot de
New email:
PHP Version: OS:

 

 [2007-12-18 15:26 UTC] php-qa at sebastianmendel dot de
Description:
------------
the input name: "fields[field[test]]" reaches the script as $_POST["fields"]["field[test"]

Reproduce code:
---------------
<html><head></head><body>
<form action="test.php" method="post">
<input type="text" name="funcs[field[test]]" value="test">
<input type="submit">
</form>
<pre><?php var_dump($_POST) ?></pre>
</body></html>

Expected result:
----------------
array(1) {
  ["funcs"]=>
  array(1) {
    ["field[test]"]=>
    string(4) "test"
  }
}

Actual result:
--------------
array(1) {
  ["funcs"]=>
  array(1) {
    ["field[test"]=>
    string(4) "test"
  }
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-01 22:45 UTC] jani@php.net
That's simply invalid form data that PHP simply won't understand. No bug here. Untested: 

<input type="text" name="funcs[field][test]" value="test">

This should work..
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC