Mercurial > urweb
diff lib/js/urweb.js @ 925:552c989c1601
Change string URLification to avoid using the empty string, which confuses Apache no2slash()
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 12 Sep 2009 09:31:50 -0400 |
parents | 771449d8b411 |
children | d136bc34e4ca |
line wrap: on
line diff
--- a/lib/js/urweb.js Thu Sep 10 14:55:27 2009 -0400 +++ b/lib/js/urweb.js Sat Sep 12 09:31:50 2009 -0400 @@ -464,10 +464,15 @@ } function uf(s) { - return escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B"); + if (s.length == 0) + return "_"; + return (s[0] == '_' ? "_" : "") + + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B"); } function uu(s) { + if (s.length > 0 && s[0] == '_') + s = s.substring(1); return unescape(s.replace(new RegExp ("\\+", "g"), " ")); }