php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61445 HttpQueryString class translates '.' in params to '_'
Submitted: 2012-03-19 21:11 UTC Modified: 2012-04-01 19:27 UTC
From: signe at cothlamadh dot net Assigned: mike (profile)
Status: Duplicate Package: pecl_http (PECL)
PHP Version: 5.3.10 OS: Ubuntu 11.10
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: signe at cothlamadh dot net
New email:
PHP Version: OS:

 

 [2012-03-19 21:11 UTC] signe at cothlamadh dot net
Description:
------------
HttpQueryString class translates '.' in params to '_'

This behavior (which is obviously being copied from parse_str) makes sense when parse_str copies parameter names into the global variable scope, but it is *invalid behavior*.  "." is a completely acceptable character for parameter names to include.

A "next generation" module shouldn't copy the bad behaviors of the function it's replacing.

Test script:
---------------
$query = 'bar.baz=blah&utm_source=google&utm_campaign=somethingelse&blat';

$foo = new HttpQueryString(false, $query);

print_r($foo->toArray());

echo $foo->toString();

Expected result:
----------------
Array
(
    [bar.baz] => blah
    [utm_source] => google
    [utm_campaign] => somethingelse
    [blat] => 
)
bar.baz=blah&utm_source=google&utm_campaign=somethingelse&blat=

Actual result:
--------------
Array
(
    [bar_baz] => blah
    [utm_source] => google
    [utm_campaign] => somethingelse
    [blat] => 
)
bar_baz=blah&utm_source=google&utm_campaign=somethingelse&blat=

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-01 19:27 UTC] mike@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: mike
 [2012-04-01 19:27 UTC] mike@php.net
As the underlying code is the same I mark it as duplicate of Bug #61444.

But thanks anyway!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC