Bug #61035 [Opn->Nab]: Null byte truncates $_GET variables
| From: | cmb@php.net | Date: | Wed, 15 Apr 2015 22:30:01 +0000 |
| Subject: | Bug #61035 [Opn->Nab]: Null byte truncates $_GET variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192119@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61035&edit=1
ID: 61035
Updated by: cmb@php.net
Reported by: halomarkguy at gmail dot com
Summary: Null byte truncates $_GET variables
-Status: Open
+Status: Not a bug
Type: Bug
Package: Apache2 related
Operating System: linux (debian squeeze)
PHP Version: 5.3SVN-2012-02-10 (SVN)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
If you pass arbitrary data as GET parameter, you have to
urlencode() them anyway.
Previous Comments:
------------------------------------------------------------------------
[2012-02-10 04:10:30] halomarkguy at gmail dot com
Description:
------------
I was working with some serialization and I found that if there's a null byte in
the $_GET variable the variable and the string disappear.
I'm not sure why a serialized object is using a null byte for private or protected
members in the first place, as null bytes are used for termination.
Test script:
---------------
on the server:
<?php
print_r($_REQUEST);
?>
Expected result:
----------------
If we send a request:
GET /bla.php?
rest_data=O:14:"LoadsCacheFile":11{s:12:"\x00*\x00_FileName";s:5:"Cache";}
HTTP/1.0
Host: 192.168.98.134
reply: 'array (\n'
array (
'rest_data' => 'O:14:"LoadsCacheFile":11:{s:12:"',
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61035&edit=1