Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

encodeForURL doesn't URL encode certain special characters #13

Open
GoogleCodeExporter opened this issue May 24, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.  encodeForURL doesn't URL encode certain special characters such as * @ - _ 
+ . /

What is the expected output? What do you see instead?
The above characters should be URL encoded.


What version of the product are you using? On what operating system?
Latest version on Linux.

Please provide any additional information below.

Looks like in DefaultEncoder.js, the encodeForURL/decodeForURL it is calling 
escape()/unescape().  It should probably call 
encodeURIComponent()/decodeURIComponent() instead.

Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 5:27

@sarahmonks
Copy link

I had this problem too. so I changed the code in esapi.js to encodeURI and decodeURI as follows:
encodeForURL: function(sInput) {
return !sInput ? null : encodeURI(sInput);
},

    decodeFromURL: function(sInput) {
        return !sInput ? null : decodeURI(sInput);
    },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants