|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: signe at cothlamadh dot net
New email:
PHP Version: OS:


 [2012-03-19 21:11 UTC] signe at cothlamadh dot net
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);


echo $foo->toString();

Expected result:
    [bar.baz] => blah
    [utm_source] => google
    [utm_campaign] => somethingelse
    [blat] => 

Actual result:
    [bar_baz] => blah
    [utm_source] => google
    [utm_campaign] => somethingelse
    [blat] => 


Add a Patch

Pull Requests

Add a Pull Request


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

But thanks anyway!
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Oct 07 10:05:52 2022 UTC