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

ajaxSubmit is not encoding newlines as CRLF pairs, but only as LF #517

Closed
hchonov opened this issue Mar 1, 2017 · 4 comments
Closed

ajaxSubmit is not encoding newlines as CRLF pairs, but only as LF #517

hchonov opened this issue Mar 1, 2017 · 4 comments

Comments

@hchonov
Copy link

hchonov commented Mar 1, 2017

@see pull request #516

@kevindb
Copy link
Contributor

kevindb commented Mar 1, 2017

This looks related to #158. How do you compare your fix vs @cgi-caesar's? Should we implement both of your changes, or would that break things further?

@hchonov
Copy link
Author

hchonov commented Mar 1, 2017

I think that it makes sense of using only the jQuery method for serializing arrays as it is doing other stuffs as well and if there are changes later to it we will get automatically an updated version and only jQuery will be responsible for the encoding and not jQuery-form anymore.

I don't think that for this case we need both issues, one of those should be sufficient, but I would prefer using the serializeArray jQuery method and letting all the responsibility to jQuery.

Implementing both solutions should not break things further, but it will add additional overhead.

I would say it is up to the maintainer to decide, which is better :).

kevindb pushed a commit that referenced this issue 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 2, 2017

While I agree with you that using jQuery's serializeArray() potentially makes sense in the long term, it would fundamentally change how the form plugin is serializing the form today.
In your PR #516, you have the line

a = this.serializeArray(this.formToArray(options.semantic, elements, options.filtering));

jQuery.serializeArray() takes no arguments, so I think the result of this.formToArray() is being thrown away in favor of jQuery's serialization. This means that the semantic and filtering options would not have any effect on the resulting serialized form values.

I have merged a modified version of @cgi-caesar's PR #421 that is consistent with jQuery's serialization source.
Please let me know if this change resolves your issue.

@kevindb
Copy link
Contributor

kevindb commented Mar 9, 2017

v4.1.0 has been released with this change.

@kevindb kevindb closed this as completed Mar 9, 2017
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

No branches or pull requests

2 participants