php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21925 Should allow dots in global variables name
Submitted: 2003-01-28 12:18 UTC Modified: 2003-01-28 12:55 UTC
From: mikep at oeone dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.2.0 OS: RedHat
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: mikep at oeone dot com
New email:
PHP Version: OS:

 

 [2003-01-28 12:18 UTC] mikep at oeone dot com
I think that in the global $_POST that PHP should not convert my "." to "_" automatically.
Eg. I had a form and posted a form element with id="calendar.defaultview", and I'd like to be able to access that with $_POST["calendar.defaultview"].
I realize that it would be inconsistent with the variable name if register_globals is on, but now that its being deprecated, this deserves another look.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-28 12:39 UTC] iliaa@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 variable do not support '.' characters in their name, therefor '.' cannot appear as is inside variables passed via GET/POST/COOKIE/ENV.
 [2003-01-28 12:52 UTC] mikep at oeone dot com
I think this deserves another look.
If the reason that . get converted to _ is because of variable names (happens with register_globals = on) and register_globals is being recommended to be OFF, then it seems logical to me that I should be allowed to access my variables as $_POST["variable.name"]
Please allow someone else to look at this.  I'd like a second opinion on this bug.  (If two people say that it shouldn't be, then I'll be OK with that.  However, I think this is a good idea, and IS a bug in PHP, or will be when register_globals won't even be allowed (hopefully soon!)) I've also posted a message to php.dev for a discussion.
 [2003-01-28 12:55 UTC] derick@php.net
I'm negative on this changes too, it will be inconsistent with when you have register_globals on. Also, allowing this will break scripts that use images for 'submit' buttons. (It's send as image.x by the browser, while PHP makes it image_x).

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 01:01:28 2024 UTC