Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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:2 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

Nope. $.param() has no business trying to guess whether you are double-encoding your string. That's up to you.

comment:3 in reply to:  2 Changed 11 years ago by kondrat

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 in reply to:  2 Changed 11 years ago by kondrat

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

Version 0, edited 11 years ago by kondrat (next)
Note: See TracTickets for help on using tickets.