From: joem at tempomg dot com Operating system: redhat linux PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug description: Could PHP leave superglobal array indices alone?
Description: ------------ I think it would make more sense if PHP only replaced '.' and ' ' with '_' when register_globals is turned on, and only for the variables that are registered in the global scope, leaving the superglobals' index names as they are. I understand that variable names can't have '.' or ' ' in them, however it seems that most people use the $_POST['variablename'] method of accessing external variables, and in this case, the spaces and dots make no difference. I could find practically no reference to this behavior in the manual, other than a couple notes I submitted. At the very least, the fact that these characters are replaced should be made more obvious in the manual under "Predefined Variables" at http://us2.php.net/manual/en/language.variables.predefined.php and http://us2.php.net/manual/en/reserved.variables.php Reproduce code: --------------- <form method="post"> <input name="title for page3.php" type="text"> <input type="submit"> </form> Title submitted: <?php if (count($_POST) > 0) echo $_POST['title for page3.php']; ?> Expected result: ---------------- I expect to see the title I submitted print out. Actual result: -------------- The POST key 'title for page3.php' is changed to 'title_for_page3_php', and nothing prints out. -- Edit bug report at http://bugs.php.net/?id=40224&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40224&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40224&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40224&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40224&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40224&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40224&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40224&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40224&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40224&r=support Expected behavior: http://bugs.php.net/fix.php?id=40224&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40224&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40224&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40224&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40224&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40224&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40224&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40224&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40224&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40224&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40224&r=mysqlcfg