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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 09:01:28 2024 UTC