Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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
Contributor

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