deparam: parse params with remaining ampersand #332

Merged
merged 1 commit into from Mar 23, 2013

Conversation

Projects
None yet
2 participants
@schovi
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Mar 22, 2013

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@schovi

schovi Mar 22, 2013

Contributor

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

Contributor

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

Merge pull request #332 from schovi/deparam-ampersand
deparam: parse params with remaining ampersand

@daffl daffl merged commit 411e934 into canjs:master Mar 23, 2013

1 check passed

default The Travis build passed
Details

@schovi schovi deleted the schovi:deparam-ampersand branch Mar 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment