Skip to main content

Bug Tracker

Side navigation

#11750 closed bug (invalid)

Opened May 11, 2012 09:11AM UTC

Closed May 11, 2012 04:18PM UTC

Last modified May 12, 2012 09:22AM UTC

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.

Attachments (0)
Change History (4)

Changed May 11, 2012 09:37AM UTC by kondrat comment:1

Changed May 11, 2012 04:18PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

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

Changed May 12, 2012 09:16AM UTC by kondrat comment:3

Replying to [comment:2 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.

Changed May 12, 2012 09:22AM UTC by kondrat comment:4

_comment0: Replying to [comment:2 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 it1336814722180031

Replying to [comment:2 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