php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30956 Post data periods (.) being converted to underscores (_)
Submitted: 2004-12-02 04:47 UTC Modified: 2004-12-02 08:27 UTC
From: phpbugs at crumpton dot cx Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.0.2 OS: redhat 7.3
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at crumpton dot cx
New email:
PHP Version: OS:

 

 [2004-12-02 04:47 UTC] phpbugs at crumpton dot cx
Description:
------------
In the key/value pairs from posted data, periods (.) within the key name (ie, "var.name=some+data") are being converted to underscores (_) (ie, "var_name=some+data").

$HTTP_RAW_POST_DATA contains the correct urlencoded data with the periods (.).  $_REQUST, $_POST, and $HTTP_POST_DATA, however, all contain keys with the periods (.) replaced as underscores (_).

Note: The "Reproduce code:" section requires "always_populate_raw_post_data = On" in php.ini to see the $HTTP_RAW_POST_DATA... You will, however, see the mangled $_POST variable either way.

Reproduce code:
---------------
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        header("Content-type: text/plain");
        print_r($HTTP_RAW_POST_DATA . "\n");
        print_r($_POST);
        die;
}
?>
<form method="post">
  <input type="text" name="var.name" value="some data" />
  <input type="submit" value="submit" />
</form>


Expected result:
----------------
var.name=some+data
Array
(
    [var.name] => some data
)

Actual result:
--------------
var.name=some+data
Array
(
    [var_name] => some data
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-02 08:28 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC