PHP 4.0 Bug #9726: the HTTP_POST_VARS are prepended by RC BS
| From: | jbeney at lisi dot insa-lyon dot fr | Date: | Tue, 13 Mar 2001 15:01:40 +0000 |
| Subject: | PHP 4.0 Bug #9726: the HTTP_POST_VARS are prepended by RC BS | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48810@lists.php.net to get a copy of this message | ||
From: jbeney@lisi.insa-lyon.fr
Operating system: Linux porky.devel.redhat.com 2.2.17-8smp #1 SMP Fri Nov 17 16:12:17 EST 2000 i686
PHP version: 4.0.4pl1
PHP Bug Type: Apache related
Bug description: the HTTP_POST_VARS are prepended by RC BS
The script below worked with php3. When the button
<input type="submit" name="Enregistrer" value="Enregistrer" >
is clicked, the variable $Enregistrer gets the value "Enregistrer" and the test
if($Enregistrer=="Enregistrer")
says yes.
We transfered our site on a server with PHP4 and then the HTTP_POST_VARS are prepended by two
characters RC BS (decimal codes 13 & 10) and the above test says no.
If I change the test to
if(strcmp(substr($Enregistrer,2),"Enregistrer")==0)
it says yes.
_____________
<html>
<head> <SCRIPT LANGUAGE="JavaScript" src="script.js">
</SCRIPT> </head>
<body>
<form method=POST enctype="multipart/form-data"
action="<? echo $PHP_SELF ?>" name="formu">
<?php
$xxx=gettype($Enregistrer);
$yyy=strlen($Enregistrer);
echo "$xxx:$yyy:$Enregistrer:<br> ";
$xxx=ord($Enregistrer[0]);
$yyy=ord($Enregistrer[1]);
echo "-$xxx-$yyy-$Enregistrer[2]-$Enregistrer[11]-$Enregistrer[12]-<br>";
$xxx=gettype("$Fonction");
$yyy=strlen("$Fonction");
echo "$xxx:$yyy:$Fonction:<br>";
$xxx=ord($Fonction[0]);
$yyy=ord($Fonction[1]);
echo "-$xxx-$yyy-$Fonction[2]-$Fonction[21]-$Fonction[22]-<br>";
/* if(strcmp(substr($Enregistrer,2),"Enregistrer")==0) */
if($Enregistrer=="Enregistrer")
{ echo "enregistrer"; }
else
{ echo "ne pas enregistrer"; }
?>
<P>
<?php PRINT "<select name=\"Fonction\">";
PRINT "<option selected value=\"$Fonction\">$Fonction";
PRINT "<option value = \"Professeur\"> Professeur</option>";
PRINT "<option value = \"Maître\"> Maître</option>";
PRINT "</select>";
?>
<p> <input type="submit" name="Enregistrer"
value="Enregistrer" > </p>
</form> </body> </html>
_________________
Configure Command
'./configure' '--prefix=/usr'
'--with-config-file-path=/etc' '--disable-debug'
'--enable-pic' '--enable-shared'
'--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs'
'--with-exec-dir=/usr/bin'
'--with-regex=system' '--with-gettext'
'--with-gd'
'--with-jpeg-dir=/usr' '--with-png'
'--with-zlib'
'--with-db2' '--with-db3' '--with-gdbm'
'--enable-debugger' '--enable-magic-quotes'
'--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp'
'--enable-ftp'
'--enable-wddx' '--without-mysql'
'--without-oracle'
'--without-oci8' '--with-xml'
__________________
other parts of phpinfo()
register_globals On
Apache Version Apache/1.3.14
Apache Release 10314100
Apache API Version 9990320
--
Edit Bug report at: http://bugs.php.net/?id=9726&edit=1