php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78236 convert error on receiving variables when duplicate [
Submitted: 2019-07-01 07:45 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: hongweichen8888 at sina dot com Assigned:
Status: Open Package: Documentation problem
PHP Version: 7.2.19 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-07-01 07:45 UTC] hongweichen8888 at sina dot com
Description:
------------
when php receivie the data from external sources, a variables named 'id[[name' will be saved into $_REQUEST['id_[name'];

@see http://php.net/manual/en/language.variables.external.php

Will '[' only be replaced once?

Test script:
---------------
<form method="post">
    <input type="text" name="id[name" value="1">
    <input type="text" name="id[[name" value="a">
    <input type="submit">
</form>

Expected result:
----------------
array ( 
  'id_name' => '1', 
  'id__name' => 'a',
)

Actual result:
--------------
array ( 
  'id_name' => '1', 
  'id_[name' => 'a',
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 11:01:27 2019 UTC