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

deparam: parse params with remaining ampersand #332

Merged
merged 1 commit into from
Mar 23, 2013
Merged

deparam: parse params with remaining ampersand #332

merged 1 commit into from
Mar 23, 2013

Conversation

schovi
Copy link
Contributor

@schovi schovi commented Mar 21, 2013

Pretty easy fix for #331

can.deparam is not able to parse following params

can.deparam("a=b&")

It fails with Cannot read property 'length' of null error.

This is pretty common case when somebody generate url wrong (in javacript, on server, or write bad url into browser)

Example http://jsfiddle.net/eRQBF/

@daffl
Copy link
Contributor

daffl commented Mar 22, 2013

It's basically just adding the if(key) statement right? If so, totally 👍 and good for 1.1.5.

@schovi
Copy link
Contributor Author

schovi commented Mar 22, 2013

Yes. It was quick to solve :)
And ofc it solves leading ampersand can.deparam("&a=1")

daffl added a commit that referenced this pull request Mar 23, 2013
deparam: parse params with remaining ampersand
@daffl daffl merged commit 411e934 into canjs:master Mar 23, 2013
@schovi schovi deleted the deparam-ampersand branch March 26, 2013 22:33
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