php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53402 "." is converted to "_" in <input type="file" name="test.txt">
Submitted: 2010-11-25 14:07 UTC Modified: 2010-11-25 14:18 UTC
From: martin dot schmitz at uni-bielefeld dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.14 OS: Mandriva 2010 spring
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: martin dot schmitz at uni-bielefeld dot de
New email:
PHP Version: OS:

 

 [2010-11-25 14:07 UTC] martin dot schmitz at uni-bielefeld dot de
Description:
------------
If a the <name>-tag of an <input> contains a dot, if is transferred to an underscore. I googled all around, but can't find anything.

I wonder because:
$test = array( 'title_image.img'=>'bla');
works. So why it is converted?

Is it a bug or a feature :-)?




Test script:
---------------
<html>
<head>
<title>Test</title>
</head>
<body>

<pre>
<?php
echo $_FILES['title_image.img']['name'];
var_dump( $_FILES);
?>
</pre>

<form name="form" method="post" action="" enctype="multipart/form-data">
<input type="file" name="title_image.img" />
<input type="submit" name="save" value="Speichern" />
</form>

</body>
</html>

Expected result:
----------------
array(1) {
  ["title_image.img"]=>
  array(5) {
    ["name"]=>
    string(0) ""
    ["type"]=>
    string(0) ""
    ["tmp_name"]=>
    string(0) ""
    ["error"]=>
    int(4)
    ["size"]=>
    int(0)
  }
}


Actual result:
--------------
Notice:  Undefined index: title_image.img in /media/DATA/home/mschmitz/public_html/customer/uni/fm/tischlerei/test.php on line 9

array(1) {
  ["title_image_img"]=>
  array(5) {
    ["name"]=>
    string(0) ""
    ["type"]=>
    string(0) ""
    ["tmp_name"]=>
    string(0) ""
    ["error"]=>
    int(4)
    ["size"]=>
    int(0)
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-25 14:18 UTC] salathe@php.net
-Status: Open +Status: Bogus
 [2010-11-25 14:18 UTC] salathe@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

From http://php.net/variables.external 
'Dots and spaces in variable names are converted to underscores. For example 
<input name="a.b" /> becomes $_REQUEST["a_b"].'
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 04:01:28 2024 UTC