[PHP-DEV] PHP 4.0 Bug #7987 Updated: POST/GET: string with NULL values not parsed correctly From: andbe611 <email protected>
Date: 11/27/00

ID: 7987
User Update by: andbe611 <email protected>
Old-Status: Feedback
Status: Open
Bug Type: HTTP related
Description: POST/GET: string with NULL values not parsed correctly

Here is a short script that shows the problem. (I guess I should have posted thins in my first bugreport, sorry)
The script null_string.php gets called with:
http://myserver.com/null_string.php?truncated=hello%00world

null_string.php:
<?php
$works= "hello\x00world";
$fp = fopen("file.txt","w");
fwrite($fp,"$works\n");
fwrite($fp,"$truncated\n");
fclose($fp);
?>

file.txt opened in an hex editor:

hex: 68 65 6C 6C 6F 00 77 6F-72 6C 64 0A 68 65 6C 6C 6F 0A
text:hello.world.hello.

The $works is saved with the null value, but the $truncated in the get request gets truncated by php.

Previous Comments:
---------------------------------------------------------------------------

[2000-11-27 06:34:58] waldschrott <email protected>
maybe duplicate of 7621

---------------------------------------------------------------------------

[2000-11-27 06:28:26] waldschrott <email protected>
are you sure they get truncated?
please echo strlen($HTTP_POST_VARS["var"]) *before* the
other output and please don't use NS 4.x it is known to
truncate an unknown number of bytes after a

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>