diff options
author | 2010-05-18 14:47:56 -0400 | |
---|---|---|
committer | 2010-05-18 14:47:56 -0400 | |
commit | f2007435ca9e15257cb80085edcbf7f897993f64 (patch) | |
tree | 3e8963a10acbb1574ae8f981a1fe663684ab82f2 /lib/js | |
parent | 46d21ab45cdc23c45296e1e336b7dbbf00849c56 (diff) |
URL-escape with '.' instead of '%', to avoid confusing proxies
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 697f197f..68beb76c 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -592,15 +592,19 @@ function pflo(s) { function uf(s) { if (s.length == 0) return "_"; - return (s.charAt(0) == '_' ? "_" : "") + encodeURIComponent(s); + s = s.replace(new RegExp ("\\.", "g"), ".2E"); + return (s.charAt(0) == '_' ? "_" : "") + encodeURIComponent(s).replace(new RegExp ("%", "g"), "."); } function uu(s) { if (s.length > 0 && s.charAt(0) == '_') { 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 decodeURIComponent(s.replace(new RegExp ("\\+", "g"), " ")); + } else if (s.length >= 3 && (s.charAt(0) == '%' || s.charAt(0) == '.') + && s.charAt(1) == '5' && (s.charAt(2) == 'f' || s.charAt(2) == 'F')) + s = s.substring(3); + s = s.replace(new RegExp ("\\+", "g"), " "); + s = s.replace(new RegExp ("\\.", "g"), "%"); + return decodeURIComponent(s); } function atr(s) { |