When submitting encode all line breaks in the values as CRLF pairs#516
Closed
hchonov wants to merge 1 commit intojquery-form:masterfrom
Closed
When submitting encode all line breaks in the values as CRLF pairs#516hchonov wants to merge 1 commit intojquery-form:masterfrom
hchonov wants to merge 1 commit intojquery-form:masterfrom
Conversation
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
Member
|
v4.1.0 has been released with a fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?