aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-05-18 14:47:56 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-05-18 14:47:56 -0400
commit25792a154d53d515917c41256610a03a0a9de5f9 (patch)
tree3e8963a10acbb1574ae8f981a1fe663684ab82f2 /lib
parente5c543adfe4a27b347ce2e78a94727f1e50c8f43 (diff)
URL-escape with '.' instead of '%', to avoid confusing proxies
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js12
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) {