option values in select lists with trailing whitespace in quotes has whitespace removed

VERIFIED FIXED in mozilla0.9.2

Status

()

Core
HTML: Form Submission
--
critical
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: blizzard, Assigned: Eric Pollmann)

Tracking

({dataloss})

Trunk
mozilla0.9.2
dataloss
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: critical for 0.9.2, URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
Build is on June 7, 2001.

If you have a bit of html like this:

<select name="test"><option value="1234    ">1234</option></select>

The value of test as submitted to the server is '1234' not '1234++++' as it
should be.  Netscape 4.x and IE get this right.

The most serious place I've seen this problem is fleet bank's online banking
login page.  You can save your card number and it includes the trailing spaces.
 Mozilla truncates the spaces.
(Reporter)

Updated

17 years ago
Keywords: dataloss

Comment 1

17 years ago
Might be bug 59248 or bug 30471 or something new.

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Future

Comment 2

17 years ago
Mass move of form submission bugs, Eric, I am sorry I don't have more time to 
look at these closer.
Assignee: rods → pollmann
Status: ASSIGNED → NEW

Comment 3

17 years ago
oops, this should be mine
Assignee: pollmann → rods
(Reporter)

Comment 4

17 years ago
Any progress on this one?
Pollmann agreed to look into this one, reassigning :-)
Assignee: rods → pollmann
OS: Linux → All
Hardware: PC → All
Target Milestone: Future → ---
(Reporter)

Updated

17 years ago
Whiteboard: want for 0.9.2
(Reporter)

Comment 6

17 years ago
pollman, is there anything I can do to help?  Give me a pointer of a chunk of
code to start looking and I'll do the initial investigation for you.
(Assignee)

Comment 7

17 years ago
Oh, sorry - the problem is here:

PRBool
nsListControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
                                     nsString* aValues, nsString* aNames)
{
...
      GetOptionValue(*options, mSelectedIndex, value);
      value.CompressWhitespace();
...

This code was added for this case:

  <select name=sel>
   <option>foo
  </select>

GetOptionValue will return "foo\r\n" this case, and CompressWhitespace strips
off all leading and trailing whitespace.  I think the fix is to be more specific
in which cases we strip whitespace, perhaps only when GetOptionValue gets the
value from the text content inside an option?  I'm looking into what IE, Nav
4.x, and Netscape 6 did in all the various permutations of these cases...
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.2
(Assignee)

Comment 8

17 years ago
Created attachment 39627 [details] [diff] [review]
patch
(Assignee)

Comment 9

17 years ago
Nisheeth says "r=nisheeth@netscape.com"
(Assignee)

Comment 10

17 years ago
Johnny says "sr=jst@netscape.com"
(Reporter)

Comment 11

17 years ago
a=blizzard on behalf of drivers for 0.9.2
Whiteboard: want for 0.9.2 → critical for 0.9.2

Updated

17 years ago
Keywords: nsenterprise
(Assignee)

Comment 12

17 years ago
Fix checked in. To verify:

View http://www.ideasuite.com/~blizzard/test/test.html
Click Submit Query
The result should be:
"1234 "

Note that a space must follow the 4. You should also verify that the URL bar is
now:

http://www.ideasuite.com/~blizzard/test/test.cgi?test=1234++++

The four trailing + signs here are the indication that the bug was fixed.
Thanks!
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 13

17 years ago
verifying fixed on build 2001-06-22-06-trunk windows 98
linux RedHat 6.2 2001-06-22-06-trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.