#20212 [NEW]: Content of form array variables will be cutted by the first 4 characters
| From: | chr at abelard dot de | Date: | Fri, 01 Nov 2002 12:23:17 +0000 |
| Subject: | #20212 [NEW]: Content of form array variables will be cutted by the first 4 characters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-23898@lists.php.net to get a copy of this message | ||
From: chr@abelard.de
Operating system: SuSE Linux 8.0
PHP version: 4.2.3
PHP Bug Type: HTTP related
Bug description: Content of form array variables will be cutted by the first 4 characters
PHP 4.2.3 will cut the first 4 characters from content of form variables,
if they are array's. This does not occur in PHP versions 4.1.1 and
4.1.2.
The following 2 files demonstrate the bug. First the HTML form:
++++++++++++++++ Begin ++++++++++++++++++++++++++++++++++
<html>
<head>
<title>Demonstrate error in form handling by PHP 4.2.3</title>
</head>
<body bgcolor=white>
<form action="http://139.18.20.141/formError.php"
method="post">
<!-- try the following URLs for "action" to see correctly working older
systems:
[PHP 4.1.1] http://www.abelard.info/formError.php
[PHP 4.1.2] http://www.stura.uni-leipzig.de/sp/formError.php
-->
<input type='checkbox' name='selectCourse[]' value='KURS_'
checked="1">KURS_ <BR>
<input type='checkbox' name='selectCourse[]'
value='ABCD_KURS_0_1'>ABCD_KURS_0_1 <BR>
<input type="submit" name="submit" value="Ok" >
</form>
</body>
</html>
--------------- End ------------------------------
Second, the processing PHP file:
+++++++++++++++++ Begin ++++++++++++++++++++++++++++++++++++
<html>
<head><title>POST-Array test</title></head>
<body>
<h1>POST-Array test</h1>
<p>
<?php
echo 'selectCourse[0]='.$_POST['selectCourse'][0]."<br>\n";
echo 'selectCourse[1]='.$_POST['selectCourse'][1];
?>
</p>
</body>
</html>
---------------- End --------------------------------
If submitted by only clicking the OK-button, this should output
...
selectCourse[0]=KURS_
...
but in fact it does this on older versions of PHP only.
PHP 4.2.3 does output instead:
...
selectCourse[0]=_
...
loosing the first 4 characters from variable content.
Note:
This occurs _only_ on array-like variables as above, normal variables
were submitted correctly.
***
Now the usual system information:
You can obtain the full configuration by calling
http://139.18.20.141/test.php
The configure line here again:
+++++++++++++++++++++++++ Begin ++++++++++++++++++++++++++
'./configure' '--prefix=/usr/share' '--datadir=/usr/share/php'
'--bindir=/usr/bin' '--libdir=/usr/share' '--libdir=/usr/local/lib'
'--includedir=/usr/include' '--includedir=/usr/local/include'
'--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin'
'--disable-debug' '--enable-bcmath' '--enable-calendar'
'--enable-ctype' '--enable-dbase' '--enable-discard-path'
'--enable-exif'
'--enable-force-cgi-redirect' '--enable-ftp'
'--enable-inline-optimization' '--enable-magic-quotes'
'--enable-mbstr-enc-trans' '--enable-mbstring' '--enable-memory-limit'
'--enable-safe-mode' '--enable-shmop' '--enable-sigchild'
'--enable-sysvsem' '--enable-sysvshm' '--enable-trans-sid'
'--enable-versioning' '--with-bz2'
'--with-dom=/usr/local/include/libxml2'
'--with-ftp' '--with-gettext'
'--with-imap=yes' '--with-jpeg-dir=/usr' '--with-mysql=/usr'
'--with-png-dir=/usr' '--with-xml' '--with-zlib=yes'
'--enable-xslt'
'--with-xslt-sablot' '--with-mm' '--with-apxs=/usr/sbin/apxs'
'--with-pcre-regex' '--without-pgsql' '--with-imap-ssl'
----------------------- End -----------------------
I have compiled PHP by getting php-4.2.3.tar.bz2 from
http://de.php.net/get_download.php?df=php-4.2.3.tar.bz2
The md5 sum is OK.
For APACHE I used the source RPM included in SuSE 8.0, that means
version "1.3.23".
##
--
Edit bug report at http://bugs.php.net/?id=20212&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20212&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20212&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20212&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20212&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20212&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20212&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20212&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20212&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20212&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20212&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20212&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20212&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20212&r=isapi