When submitting encode all line breaks in the values as CRLF pairs #516
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?