PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Request » Bug #4051

Overwrite multiple query string parameters

Details

Submitted2005-04-04 12:39 UTC
Fromgormer at opera dot com
StatusBogus
PackageHTTP_Request
PHP Version5.0.3
OSWindows
Roadmaps(Not assigned)

Comments

[2005-04-04 12:39 UTC] gormer at opera dot com

Description:
------------
When doing a request with HTTP_Request it seems like it only pass one variable as the QUERY_STRING to the server although it should be legal to use variables with same name. HTTP_Request is probably breaking the spec with regards to this.

I have seen bug #3260 where a confused developer seems to think they are doing the right thing. http://server/script?var=1&var=2 is perfectly legal. What happens to $_GET is not interesting..the interesting part is that the enviorment variable QUERY_STRING should be right.

According to the CGI specification you shall not do any recoding of what is passed after the ? which HTTP_Request does and therefore probably breaks the spec.

Reproduce code:
---------------
$r = new HTTP_Request("http://server/script?var=1&var=2");
$r->sendRequest();

Expected result:
----------------
HTTP_Request should do the request as stated (http://server/script?var=1&var=2).

Actual result:
--------------
HTTP_Request does the request http://server/script?var=2

It seems like it's overwriting the var instead of passing both to the server. I expect the enviroment variable QUERY_STRING to be set to "var=1&var=2" instead of todays "var=2"

[2005-04-04 12:57 UTC] gormer at opera dot com

Btw. fopen seems to do the right thing. If you do fopen("http://server/script?v=1&v=2", "r") it sends just the expected (v=1&v=2) as the query string.