bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

newlines in hidden inputs are stripped

VERIFIED DUPLICATE of bug 15204

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED DUPLICATE of bug 15204
18 years ago
18 years ago

People

(Reporter: John Keiser (jkeiser), Assigned: harishd)

Tracking

Trunk
Future
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
I have verified this on Linux and Windows.  I am aware that the spec talks about
this behavior (<A
HREF="http://www.w3.org/TR/html4/interact/forms.html#h-17.4">Here</A>), but
consider these two points which have led to many CGI developers (like myself) to
use this.

1. IE and Netscape both treat hidden inputs specially, preserving newlines.
2. There appears to be no other way to pass a hidden field with newlines in it,
especially one that works in all browsers.

These two things have made it necessary and reasonable in the past to use hidden
fields with newlines.  I think CGI apps will require heavy redesign if it is not so.

&lt;INPUT TYPE=hidden VALUE="a
b"&gt;

Actual Results:  The URL shows, after form submission:
http://home.earthlink.net/~johnkeiser/mozbug/hidden-field.html?blah=ab

Expected Results:  The URL shows (on Netscape):
http://home.earthlink.net/~johnkeiser/mozbug/hidden-field.html?blah=a%0Ab
(Reporter)

Comment 1

18 years ago
Created attachment 12341 [details]
The test case mentioned in the URL.
(Reporter)

Comment 2

18 years ago
Oops, changed the URL to my home address.

Comment 3

18 years ago
I dumped the content and it looks like it is being stripped in the ContentSink:

docshell=00F0C810
html@024CAF88 refcount=3<
  head@024CAED8 refcount=2<
  >
  Text@0236D0F0 refcount=3<\n>
  body@0236EC58 refcount=3<
    Text@02329DA0 refcount=3<\n>
    form@02329CAC method=Get refcount=3<
      Text@02329100 refcount=3<\n>
      input@0232FFAC type=hidden name=blah value=ab refcount=5<>
      Text@0232F730 refcount=3<\n>
      input@0232F68C type=submit refcount=4<>
      Text@0232F4B0 refcount=3<\n>
    >
    Text@0232DFB0 refcount=3<\n>
  >
>
Assignee: rods → harishd
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 4

18 years ago
This bug has been marked "future" because the original netscape engineer working 
on this is over-burdened. If you feel this
is an error, that you or another known resource will be working on this bug,or 
if it blocks your work in some way -- please
attach your concern to the bug for reconsideration. 
Target Milestone: --- → Future
(Reporter)

Comment 5

18 years ago
As long as "future" means "sometime before Netscape 6.0 comes out," I'm OK with 
that.  But seriously, it is a huge issue for anyone writing CGI forms that 
submit values around, which happens on many intranets.  This destroys newlines 
in data that is passed in hidden fields, which is a way many CGIs pass values 
across multiple forms (including my application).

I would also like to know if Netscape considers this a bug or not.  That 
determination will definitely take much less time than fixing it.  I'd hate for 
myself (or someone else) to waste time fixing it when it is not considered a 
bug.

I have found a way to work around the bug in the interim, from Bugzilla's login 
page in fact, which is to change newlines on the server end into &#013; and 
other such things.

*** This bug has been marked as a duplicate of 15204 ***
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE

Comment 7

18 years ago
Updating QA contact.
QA Contact: ckritzer → bsharma

Comment 8

18 years ago
Verified dupe.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.