php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20355 Eating the first 4 characters of array variables submitted through forms
Submitted: 2002-11-11 05:26 UTC Modified: 2003-04-06 21:11 UTC
From: brett at brettodonnell dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 4.2.3 OS: RedHat 7.2
Private report: No CVE-ID: None
 [2002-11-11 05:26 UTC] brett at brettodonnell dot com
Variables are having the first 4 characters chopped off when submitted through a form...

Inputs like this:
<input type=text name=left[size]>

I have a form that looks like this (cut down):
----------------------
<form> 
$left["size"]: <input type=text name=left[size]> array variable<br> 
$size: <input type=text name=size> normal variable<br> 
<input type=submit> 
</form> 
<br> 
<br>$left["size"]: <?php print $left["size"]; ?> 
<br>$size: <?php print $size; ?>
----------------------

The variable $size works as expected.

The variable $left["size"] has the first 4 characters stripped if the variable is 4 or more characters.


I enter these: 

123 - works as intended 

1234 - strips the first 4 characters leaving the variable empty 

1234567890 - will strip the first 4 characters leaving the variable as "567890" 

red - works as intended 

blue - strips the first 4 characters leaving the variable empty 

orange - will strip the first 4 characters leaving the variable as "ge" 


The same problems do NOT occur on Windows XP.  

I am changed back to PHP 4.2.2 and it was fixed.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-11 05:27 UTC] moriyoshi@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC