Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   PB with euro sign and checkbox in multipart/form-data (http://www.velocityreviews.com/forums/t898048-pb-with-euro-sign-and-checkbox-in-multipart-form-data.html)

Yohan N. Leder 05-18-2006 05:00 PM

PB with euro sign and checkbox in multipart/form-data
 
Hi,

What do you think about the pb explained in this test script called
form2dump.pl :

#!/usr/bin/perl -w
# Script written to solve the bug explained below :
# PB : sign in any form field corrupt beginning of multipart/form-data
# in STDIN (1st lines with boundary & 1st field declar truncated)
# CAUSE : checkbox without any value (uncheckd) cause this pb
# - without <input type='checkbox' name='chk'>, it works
# - with <input type='checkbox' name='chk'> checked, it works
# NB : strange because an unchecked box shouldn't be sent !
# IDEA : I've tried to provide an hidden field with same name as
# checkbox which would submit an 'off' value when checkbox is
# unchecked, but both values are sent when checkbox is checked
# SOL : ?

print "Content-type: text/html; charset=iso-8859-1\n\n";
if ($ENV{'QUERY_STRING'} =~ /add/)
{
read STDIN, my $buff, $ENV{'CONTENT_LENGTH'};
print "<b>Multipart/form-data (ok because no binary data inside)
</b><hr>$buff";
}
else
{
print <<FORM;
<form action='/cgi-bin/form2dump.pl?add'
method='post' enctype='multipart/form-data' accept-charset='iso-8859-
1'>
<input type='text' name='txt1'><br>
<input type='text' name='txt2'><br>
<input type='text' name='txt3'><br>
<input type='text' name='txt4'><br>
<input type='text' name='txt5'><br>
<input type='submit'>
<input type='checkbox' name='chk' value='on'>
</form>
FORM
}
exit 0;

Brian McCauley 05-18-2006 05:42 PM

Re: PB with euro sign and checkbox in multipart/form-data
 

Yohan N. Leder wrote:

> What do you think about the pb explained in this test script


I think it appears that you are talking about a web browser bug.

> # PB : sign in any form field corrupt beginning of multipart/form-data


> <form action='/cgi-bin/form2dump.pl?add'
> method='post' enctype='multipart/form-data' accept-charset='iso-8859-
> 1'>


There is no (Euro) in iso-8859-1

> <input type='text' name='txt1'><br>


If your browser is allowing you to type a into a one of those
fields then it is broken and you should file a bug report.

Having let you enter invalid data you say your browser then gets
confused about constructing the multipart/form-data response but
obviously there would be no point my attempting to reproduce this as my
browser dosen't exhibit the first bug so can't be the one you are
using.

Anyhow I can't see haw any of this relates to Perl.


Brian McCauley 05-18-2006 06:07 PM

Re: PB with euro sign and checkbox in multipart/form-data
 

Brian McCauley wrote:
> Yohan N. Leder wrote:
>
> > What do you think about the pb explained in this test script

>
> I think it appears that you are talking about a web browser bug.
>
> > # PB : sign in any form field corrupt beginning of multipart/form-data

>
> > <form action='/cgi-bin/form2dump.pl?add'
> > method='post' enctype='multipart/form-data' accept-charset='iso-8859-
> > 1'>

>
> There is no (Euro) in iso-8859-1
>
> > <input type='text' name='txt1'><br>

>
> If your browser is allowing you to type a into a one of those
> fields then it is broken and you should file a bug report.


I have just noticed this bug is present in the browser I'm using after
all.

> Having let you enter invalid data you say your browser then gets
> confused about constructing the multipart/form-data response but
> obviously there would be no point my attempting to reproduce this as my
> browser dosen't exhibit the first bug so can't be the one you are
> using.


My browser does not exibit the second bug. I'm guessing it may be to
do with multi-byte encodings and the "Content-length" header.

> Anyhow I can't see haw any of this relates to Perl.


I stand by that.


Tad McClellan 05-18-2006 09:43 PM

Re: PB with euro sign and checkbox in multipart/form-data
 
Yohan N Leder <ynleder@nspark.org> wrote:

> What do you think about the pb explained in this test script

^^
^^

I read the whole program, but I did not see any explanation
of Peanut Butter...


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Yohan N. Leder 05-18-2006 10:03 PM

Re: PB with euro sign and checkbox in multipart/form-data
 
In article <1147975631.756701.251310@u72g2000cwu.googlegroups .com>,
nobull67@gmail.com says...
> > Anyhow I can't see haw any of this relates to Perl.

>
> I stand by that.
>


It's just related to Perl because I'm using a Perl tet script to expose
the bug and, obviously, if I'll go to post this same script in a groups
not related to Perl, I'll heard : "no no, it's not related to our group,
because your script is in Perl and we don't know Perl"... Well, I'm
trying all the same in another group...

Also, my test are done using IE6 FR under Win2K Pro and ActivePerl 5.8.7

Yohan N. Leder 05-19-2006 09:26 AM

Re: PB with euro sign and checkbox in multipart/form-data
 
In article <slrne6pqka.2c5.tadmc@magna.augustmail.com>,
tadmc@augustmail.com says...
> I read the whole program, but I did not see any explanation
> of Peanut Butter...
>


Did you ran the script ?

Yohan N. Leder 05-19-2006 09:28 AM

Re: PB with euro sign and checkbox in multipart/form-data
 
In article <1147974127.600627.268740@j55g2000cwa.googlegroups .com>,
nobull67@gmail.com says...
> There is no =80 (Euro) in iso-8859-1
>


Right but I'm able to enter it using the [Alt-Gr] + E combination on
Azerty keyboard. I've tried this on three stations using IE6 and Win2K
or XP and, don't know why, but it works.

Dr.Ruud 05-19-2006 01:03 PM

Re: PB with euro sign and checkbox in multipart/form-data
 
Yohan N. Leder schreef:

> # PB : sign in any form field corrupt beginning of


You are including a character >127 in a posting that has no Content-Type
header field that explains which character is meant there.
Also there is no Content-Transfer-Encoding header field about 8bits. The
default is 7bits (ASCII), so newsclients will set the highest bit of all
out-of-band characters to zero.

To find the error in the HTML that you generate, read
http://en.wikipedia.org/wiki/ISO_8859-1

--
Affijn, Ruud

"Gewoon is een tijger."



Tad McClellan 05-19-2006 01:29 PM

Re: PB with euro sign and checkbox in multipart/form-data
 
Yohan N Leder <ynleder@nspark.org> wrote:
> In article <slrne6pqka.2c5.tadmc@magna.augustmail.com>,
> tadmc@augustmail.com says...
>> I read the whole program, but I did not see any explanation
>> of Peanut Butter...
>>

>
> Did you ran the script ?



No.


You seem to have missed my point.

Please don't use cutsie spellings in Usenet posts.

"PB" might mean "peanut butter".

"problem" clearly means "problem", so use that instead.


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Yohan N. Leder 05-22-2006 12:08 PM

Re: PB with euro sign and checkbox in multipart/form-data
 
In article <slrne6ri12.4n0.tadmc@magna.augustmail.com>,
tadmc@augustmail.com says...
> "PB" might mean "peanut butter".
>


Sorry, it was out of habit while 'pb' means usually 'problem' in french


All times are GMT. The time now is 09:44 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.