diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-12-24 10:44:53 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-12-24 10:44:53 -0500 |
commit | 811e5474313fc8fc959bee1a58e51c4c55f350ec (patch) | |
tree | cf76b77aad3472dffdc66f3b00386d2fbe0b84b9 /lib | |
parent | 0c607fbf24eb6e55f99f80ee725c02f94cc10d1a (diff) |
Proper JavaScript-side URI escaping/de-escaping; fix C-side URL encoding of big characters
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 15c9df7e..bd575cc9 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -583,8 +583,7 @@ function pflo(s) { function uf(s) { if (s.length == 0) return "_"; - return (s.charAt(0) == '_' ? "_" : "") - + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B"); + return (s.charAt(0) == '_' ? "_" : "") + encodeURIComponent(s); } function uu(s) { @@ -592,7 +591,7 @@ function uu(s) { s = s.substring(1); } else if (s.length >= 3 && s.charAt(0) == '%' && s.charAt(1) == '5' && (s.charAt(2) == 'f' || s.charAt(2) == 'F')) s = s.substring(3); - return unescape(s.replace(new RegExp ("\\+", "g"), " ")); + return decodeURIComponent(s.replace(new RegExp ("\\+", "g"), " ")); } function ub(b) { |