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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
30 - 11 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 22:01:28 2024 UTC