Bug #54703 [Opn->Bgs]: When containing a null character, $_GET variable not set (properly)
| From: | johannes@php.net | Date: | Wed, 11 May 2011 09:15:56 +0000 |
| Subject: | Bug #54703 [Opn->Bgs]: When containing a null character, $_GET variable not set (properly) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-160675@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: johannes@php.net
Reported by: php at tracking-celebs dot info
Summary: When containing a null character, $_GET variable not
set (properly)
-Status: Open
+Status: Bogus
Type: Bug
Package: *General Issues
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
No bug. Closing.
Previous Comments:
------------------------------------------------------------------------
[2011-05-10 23:31:10] php at tracking-celebs dot info
On that linux machine there is suhosin indeed, so it could be causing
the problem. I just tried on another computer with a new vanilla
php-5.2.17 and then got the same results as did on windows.
Would seem indeed to be caused by suhosin; however i just added suhosin
on there and it still worked then as before, so there must be something
else on that other computer...
Anyways, can't reproduce it with a vanilla php, so that's that. I got
things mixed up, seems there's no bug here after all; Apologies.
------------------------------------------------------------------------
[2011-05-10 19:39:23] rasmus@php.net
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.
------------------------------------------------------------------------
[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