php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20655 Arrays and Hashes get cut-off the first 4 characters
Submitted: 2002-11-26 12:52 UTC Modified: 2003-04-06 21:12 UTC
From: joel at elserver dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 4.2.3 OS: Linux Slackware 8.1 Kernel 2.419
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:
47 + 20 = ?
Subscribe to this entry?

 
 [2002-11-26 12:52 UTC] joel at elserver dot com
Whenever a GET/POST is done from a web form, the resulting $_GET, $_POST arrays are auto-generated with the first 4 chars of the string cut-off IF the string is 4 or more chars.

For instance:

<form method="get">
name: <input type="text" name="test[name]"><br>
age: <input type="text" name="test[age]"><br>
<input type="submit">
</form>

completed with name = "123456"
and age = "654321"

would generate:

(with this code)
<pre>
<?=print_r($_GET)?>
</pre>

the following:

Array
(
    [0] => 56
    [1] => 21
)

as you can see the first 4 chars have been truncated.

it's been done with linux slackware 8.1, kernel 2.4.19+grsecurity on AMD and Intel microprocessors.

the configure line:

#!/bin/sh

./configure \
--prefix=/usr/local/php \
--enable-force-cgi-redirect \
--with-zlib \
--enable-sockets \
--with-mysql=/usr/local/mysql \
--enable-memory-limit \
--with-mm=/root/software/apache/mm-1.1.3/ \
--with-gd=/usr/local/gd-lib \
--enable-ftp \
--enable-calendar \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir= \
--enable-gd-native-ttf \
--with-mcrypt=/usr/local/lib/libmcrypt \
--enable-inline-optimization \
--enable-pcntl \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-mbregex \
--with-imap=/root/software/lib/imap-2002/ \
--with-imap-ssl \
--with-openssl

with version 4.2.3. have not tested any variants.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-26 12:55 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.

Also try --disable-mbstring if you still want to use the released version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC