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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 17:01:27 2025 UTC