Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 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 8 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 8 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's double-encoding after $.param, and problem is in $.param, because it's using encodeURIComponent without ability to disable it

Last edited 8 years ago by kondrat (previous) (diff)
Note: See TracTickets for help on using tickets.