|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
11 + 21 = ?
Subscribe to this entry?

 [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-2021 The PHP Group
All rights reserved.
Last updated: Thu May 06 22:02:20 2021 UTC