Bug #54703 [NEW]: When containing a null character, $_GET variable not set (properly)
| From: | php at tracking-celebs dot info | Date: | Tue, 10 May 2011 17:21:31 +0000 |
| Subject: | Bug #54703 [NEW]: When containing a null character, $_GET variable not set (properly) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-160665@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: 5.2.17
Package: *General Issues
Bug Type: Bug
Bug description:When containing a null character, $_GET variable not set (properly)
Description:
------------
When a null character is present in the value of a variable in the request
string (encoded as %00), said variable will either not be set in $_GET at
all (linux) or be set improperly (null character is escaped; win32)
Test script:
---------------
<?php
print_r($_GET);
if (isset($_GET['fb']))
{
echo strlen($_GET['fb']);
}
else
{
echo '<a href="?fb=foo%00bar">click me</a>';
}
Expected result:
----------------
After clicking the link:
Array
(
[fb] => foo�bar
)
7
Actual result:
--------------
After clicking the link:
- On a linux setup:
Array
(
)
<a href="?fb=foo%00bar">click me</a>
- On a win32 setup:
Array
(
[fb] => foo\0bar
)
8
--
Edit bug report at http://bugs.php.net/bug.php?id=54703&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54703&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54703&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54703&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54703&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54703&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54703&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54703&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54703&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54703&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54703&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54703&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54703&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54703&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54703&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54703&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54703&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54703&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54703&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54703&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54703&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54703&r=mysqlcfg