Bug #54703 [Opn->Fbk]: When containing a null character, $_GET variable not set (properly)
| From: | rasmus@php.net | Date: | Tue, 10 May 2011 17:39:23 +0000 |
| Subject: | Bug #54703 [Opn->Fbk]: When containing a null character, $_GET variable not set (properly) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-160667@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54703&edit=1
ID: 54703
Updated by: rasmus@php.net
Reported by: php at tracking-celebs dot info
Summary: When containing a null character, $_GET variable not
set (properly)
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
On Linux this is not true unless you have something specifically
filtering these
on you. Without ext/filter, suhosin or your own filter code, nulls go
through
fine. See: http://progphp.com/null.php?fb=foo%00bar
And the source for the script: http://progphp.com/null.phps
And it shouldn't be any different on Windows.
Previous Comments:
------------------------------------------------------------------------
[2011-05-10 19:21:28] php at tracking-celebs dot info
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 this bug report at http://bugs.php.net/bug.php?id=54703&edit=1