#19474 [Opn->Csd]: $_POST values are truncated
| From: | derick@php.net | Date: | Wed, 18 Sep 2002 10:55:32 +0000 |
| Subject: | #19474 [Opn->Csd]: $_POST values are truncated | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-19620@lists.php.net to get a copy of this message | ||
ID: 19474
Updated by: derick@php.net
Reported By: php-jp@typhoon.jp
-Status: Open
+Status: Closed
Bug Type: Variables related
Operating System: FreeBSD 4.X
PHP Version: 4.2.3
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Already fixed, recompile --without-mb-str-enc (or simlilar) to make
this go away with 4.2.3.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-09-18 05:52:20] php-jp@typhoon.jp
When checkboxes are used in a form with arrays (e.g. name=something[])
values retrieved from the resulting $_POST[something] array are
trunacted. In fact, the first 4 bytes are truncated.
If values are POSTED one by one, i.e. not via an array, things seem to
work.
The same script used to work on 4.2.2. I discovered this problem after
upgrading to 4.2.3
---sample form starts---
<html>
<head>
</head>
<form action="prob1.php" method="POST">
<input type=checkbox name=somevar[]
value="01234567890abcdefghijklmnopqrstu">
01234567890abcdefghijklmnopqrstu<br>
<input type=checkbox name=somevar[]
value="abcdefghijklmnopqrstu">abcdefghijklmnopqrstu<br>
<input type=checkbox name=somevar[] value="01234567">01234567<br>
<input type=checkbox name=somevar[] value="0123456">0123456<br>
<input type=checkbox name=somevar[] value="012345">012345<br>
<input type=checkbox name=somevar[] value="01234">01234<br>
<input type=checkbox name=somevar[] value="0123">0123<br>
<input type=checkbox name=somevar[] value="012">012<br>
<input type=checkbox name=somevar[] value="01">01<br>
<input type=checkbox name=somevar[] value="0">0<br>
<input type="submit" value="OK">
</body>
</html>
---sample form ends---
---PHP used to process above starts---
<html>
<head>
</head>
<?
$somevar_arr = $_POST["somevar"];
if( sizeof( $somevar_arr ) ) {
for( $i = 0; $i < count( $somevar_arr ); $i++ ) {
printf("somevar[%d]: %s <br>", $i, $somevar_arr[$i] );
}
}
for( $i = 0; $i < count( $_ENV ); $i++ ) {
printf("env[%d]: %s <br>", $i, $ENV[$i] );
}
?>
<hr>
</body>
</html>
---scripts ends ---
Results generated by script:
somevar[0]: 4567890abcdefghijklmnopqrstu
somevar[1]: efghijklmnopqrstu
somevar[2]: 4567
somevar[3]: 456
somevar[4]: 45
somevar[5]: 4
somevar[6]:
somevar[7]: 012
somevar[8]: 01
somevar[9]: 0
-------------------------
===end of report===
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19474&edit=1