#43268 [NEW]: minnig/incorrect infos about parsing QUERY_STRING/variable names
| From: | carsten_sttgt at gmx dot de | Date: | Mon, 12 Nov 2007 18:49:19 +0000 |
| Subject: | #43268 [NEW]: minnig/incorrect infos about parsing QUERY_STRING/variable names | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-203@lists.php.net to get a copy of this message | ||
From: carsten_sttgt at gmx dot de
Operating system: Windows_NT
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: minnig/incorrect infos about parsing QUERY_STRING/variable names
Description:
------------
Hello,
according to Bug #43253, there are missing/incorrect infos in the
documentation.
> not allowed ...
> (Or in superglobal key names because of register_globals)
It's no problem to use:
| <?php
| error_reporting(E_ALL | E_STRICT);
|
| $_GET["a\0aa"] = 'test';
| var_dump($_GET);
| ?>
No Warning, no error. --> working --> allowed ;-)
> null is not allowed in PHP variable names.
OK, that's according to the manual [1]:
| A valid variable name starts with a letter or underscore, followed
| by any number of letters, numbers, or underscores. As a regular
| expression, it would be expressed thus:
| '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
But on this page [2] I can't read, that the variable name with "\0" will
be stripped off. Because is it's not allowed, there should be no variable.
And what's about variables with non printable chars? These names are also
not allowed (see above), but working. And I can't read anything about this
behaviour:
| <?php
| error_reporting(E_ALL | E_STRICT);
|
| $a = "a\x10aa";
| $$a = 'test';
| var_dump($$a);
| ?>
Via a GET request this is:
| <a href="?a%10aa=test">Testlink</a>
These infos are also missing in the documentation for parse_str() [3].
Don't you think it's better, the replace all this chars with "_" if they
are comming from a GET request?
BTW:
On this page [2], I can only read that a "." will be replaced with "_".
But not, that a " " will also be replaced.
Conclusion:
If the PHP behaviour is correct, this should all be documented in the PHP
manual.
Regards,
Carsten
[1] http://www.php.net/manual/en/language.variables.php
[2] http://www.php.net/manual/en/language.variables.external.php
[3] http://de.php.net/manual/en/function.parse-str.php
--
Edit bug report at http://bugs.php.net/?id=43268&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43268&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43268&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43268&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43268&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43268&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43268&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43268&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43268&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43268&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43268&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43268&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43268&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43268&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43268&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43268&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43268&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43268&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43268&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43268&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43268&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43268&r=mysqlcfg