If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

POST of a form with hidden field removes trailing linefeed character from value

RESOLVED DUPLICATE of bug 114997

Status

()

Core
HTML: Form Submission
RESOLVED DUPLICATE of bug 114997
15 years ago
15 years ago

People

(Reporter: Gareth Edwards, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030529
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030529

I have an HTML form with a hidden field; the value of the field is, say,
"test
test
"

When this form is submitted to the CGI the field is POSTed to the CGI without
the trailing line feed.



Reproducible: Always

Steps to Reproduce:
Here's the example CGI script I used to diagnose the issue.

#!/devl/perl/5.6.1/bin/perl -w

$request_method = $ENV{'REQUEST_METHOD'};

if ($request_method eq "POST") {
    read (STDIN, $query_string, $ENV{'CONTENT_LENGTH'});
    print "Content-type: text/plain", "\n\n";
    @chars = unpack('C*', $query_string);
    foreach $c (@chars) {
	print "$c " . chr($c) . "\n";
    }
} else {
    print "Content-type: text/html", "\n\n";
    print <<EOF
<HTML>
<HEAD><TITLE>Title</TITLE></HEAD>
<BODY>
<FORM ACTION="/twiki/bin/testcgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="hidden0" VALUE="test&#10;test value&#10;">
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</BODY></HTML>
EOF
}

Actual Results:  
When I press the submit button I get 

104 h
105 i
100 d
100 d
101 e
110 n
48 0
61 =
116 t
101 e
115 s
116 t
37 %
48 0
68 D
37 %
48 0
65 A
116 t
101 e
115 s
116 t
43 +
118 v
97 a
108 l
117 u
101 e



Expected Results:  
I expected to get back (and, dare I say it, IE5 returns)

104 h
105 i
100 d
100 d
101 e
110 n
48 0
61 =
116 t
101 e
115 s
116 t
37 %
48 0
68 D
37 %
48 0
65 A
116 t
101 e
115 s
116 t
43 +
118 v
97 a
108 l
117 u
101 e
37 %
48 0
68 D
37 %
48 0
65 A

In other words, I expected Mozilla to preserve the value of the text field.

Comment 1

15 years ago

*** This bug has been marked as a duplicate of 114997 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.