#11750 closed bug (invalid)
Double encoding in $.param
Reported by: | kondrat | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you use $.param with already encoded value you'll get wrong value
E.g.: $.param( {paramName: "36.593812%2C50.59396"} transforms to string "paramName=36.593812%252C50.59396"
But expected value was "paramName=36.593812%2C50.59396" I think using decodeURIComponent for each param( maybe optional ) will fix this problem properly.
Change History (4)
comment:1 Changed 11 years ago by
comment:2 follow-ups: 3 4 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Nope. $.param()
has no business trying to guess whether you are double-encoding your string. That's up to you.
comment:3 Changed 11 years ago by
Replying to dmethvin:
Nope.
$.param()
has no business trying to guess whether you are double-encoding your string. That's up to you.
Actually if you encode param when convert object to string, you should give ability to disable encode function.
comment:4 Changed 11 years ago by
Replying to dmethvin:
Nope.
$.param()
has no business trying to guess whether you are double-encoding your string. That's up to you.
Please look at example again,it double encoded after $.param, and problem is in $.param, because it use encodeURIComponent without ability to disable it
http://jsfiddle.net/thVwM/1/