diff options
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) { |