#37040 [Opn]: autoconversion of variable names should be turned off
| From: | indeyets at gmail dot com | Date: | Tue, 11 Apr 2006 14:09:13 +0000 |
| Subject: | #37040 [Opn]: autoconversion of variable names should be turned off | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95605@lists.php.net to get a copy of this message | ||
ID: 37040
User updated by: indeyets at gmail dot com
-Summary: autoconversion of variabel names should be turned off
Reported By: indeyets at gmail dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: FreeBSD 5.4
PHP Version: 5.1.2
New Comment:
to make myself clear:
I propose to turn off substitution of 'dots' with 'underscores' in
variable names only for autoglobal-arrays.
Substitution still should be made for registered globals.
Previous Comments:
------------------------------------------------------------------------
[2006-04-11 13:49:26] indeyets at gmail dot com
Description:
------------
Currently, PHP does autoconversion of 'dots' in external variable names
to 'underscores'. It is documented here:
http://ru.php.net/variables.external
It does make sense when application has register_globals enabled and
prevents losing of incorrectly named variables.
Though, it doesn't make sense when register_globals setting is
disabled. In this mode, all external variables are placed inside of
associative array, and 'dot' is just as legal for the key-name as
'underscore' is
Reproduce code:
---------------
<?php
echo '<a
href="'.$_SERVER["SCRIPT_NAME"].'?var.name=value">test</a><hr>';
echo '<pre>';
var_dump($_GET);
echo '</pre>';
?>
Expected result:
----------------
array(1) {
["var_name"]=>
string(5) "value"
}
Actual result:
--------------
array(1) {
["var.name"]=>
string(5) "value"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37040&edit=1