#6876 closed bug (fixed)
Newline in form data should be encoded as CRLF pair
Reported by: | dmethvin | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | ajax | Version: | 1.4.2 |
Keywords: | form, newline, crlf, pair, ajaxrewrite | Cc: | |
Blocked by: | Blocking: |
Description
See this post:
Summary: The .value property of a textarea returns only LF between lines on all browsers but IE/Opera, but the W3C says lines should be delimited by CRLF when the form is submitted.
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1
Change History (7)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Keywords: | newline crlf pair added |
---|---|
Milestone: | 1.4.3 → 1.5 |
Priority: | → undecided |
Status: | new → open |
Marking for review and possible inclusion in 1.5.
comment:3 Changed 9 years ago by
Keywords: | ajaxrewrite added |
---|
comment:4 Changed 9 years ago by
Owner: | set to dmethvin |
---|---|
Status: | open → assigned |
comment:5 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
When serializing text, encode all line breaks as CRLF pairs per the application/x-www-form-urlencoded specification. Fixes #6876.
Changeset: eed3803c98bf5c074e40aad12f2e91435bf81154
comment:6 Changed 9 years ago by
Priority: | undecided → low |
---|
Note: See
TracTickets for help on using
tickets.
As I read the spec, it seems like *all* line breaks of LF should be replaced with CRLF, which makes the fix easier than special-casing a textarea.
Looks like this could be fixed in serializeArray:
(In two places...)
Another possibility would be to fix it in .val(), which is currently normalizing line endings by removing the CR in browsers where it's present -- IE and Opera. I like that fix better in some ways but am concerned that it will break too much existing code that expects a lone LF.