Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

When submitting encode all line breaks in the values as CRLF pairs#516

Closed
hchonov wants to merge 1 commit intojquery-form:masterfrom
hchonov:ensure_newline_in_submitted_values_is_CRLF
Closed

When submitting encode all line breaks in the values as CRLF pairs#516
hchonov wants to merge 1 commit intojquery-form:masterfrom
hchonov:ensure_newline_in_submitted_values_is_CRLF

Conversation

@hchonov
Copy link

@hchonov hchonov commented Mar 1, 2017

We've just found out in Drupal (@see https://www.drupal.org/node/2856801) that ajax submission through ajaxSubmit don't hold up to the specification and is not encoding new lines as CRLF pairs, but only as LF.
This leads to a difference between browser and ajax submission and the values are different, which might have all possible consequences in the later processing. Browsers encode new lines as CRLF pairs, so should ajax submission as well.

jQuery has a support for this and introduced the functions serialize and serializeArray, which are processing the form values and ensuring new lines are encoded as CRLF pairs. This change hasn't been yet adopted in jquery-form, but it should.

Links about this, that I've found:
https://bugs.jquery.com/ticket/9007
https://bugs.jquery.com/ticket/6876

And the according commit:
jquery/jquery@eed3803

I hope it could be backported as well?

kevindb pushed a commit that referenced this pull request Mar 2, 2017
per the application/x-www-form-urlencoded specification

#158 #421 #516 #517

Follows jQuery's lead:
jquery/jquery@eed3803
5bf81154
@kevindb
Copy link
Member

kevindb commented Mar 9, 2017

v4.1.0 has been released with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants