php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67755 Malformation HTTP GET request in array form with equal sign
Submitted: 2014-08-04 08:01 UTC Modified: 2014-08-04 08:15 UTC
From: fethi dot kus at tribal-im dot com Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.5.15 OS: Centos 6.5
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: fethi dot kus at tribal-im dot com
New email:
PHP Version: OS:

 

 [2014-08-04 08:01 UTC] fethi dot kus at tribal-im dot com
Description:
------------
An HTTP GET request in array form with equal sign gives an unexpected result.



Test script:
---------------
//Http Request
#index.php?query1[=]=1

print_r($_GET);
//or
print_r(filter_input_array(INPUT_GET));

Expected result:
----------------
Array
(
    [query1] => Array
        (
            [=] => 1
        )

)

Actual result:
--------------
Array
(
    [query1_] => ]=1
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-04 08:15 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2014-08-04 08:15 UTC] requinix@php.net
The HTTP/URL specs do not give special consideration for the [] array syntax that PHP (and a couple other languages) support. = is a reserved character and if needed for something other than its reserved purpose then it must be percent-encoded.

As for the underscore, PHP starts with "query1[" as the key and it replaces the '[' with an underscore for historical purposes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC