Bug 410726 - "address bar eats escaped newlines" (keep non-space whitespace encoded) [p=zeniko@gmail.com (Simon Bünzli) r=Mano a1.9=schrep]
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1906,19 +1906,20 @@ function URLBarSetURI(aURI) {
value = aURI.spec;
if (value == "about:blank") {
// Replace "about:blank" with an empty string
// only if there's no opener (bug 370555).
if (!content.opener)
value = "";
} else {
- // try to decode as UTF-8
+ // try to decode as UTF-8 (escaping whitespace so that it doesn't
+ // get eaten away by the location bar; cf. bug 410726)
try {
- value = decodeURI(value).replace(/%/g, "%25");
+ value = decodeURI(value).replace(/[%\r\n\t]/g, encodeURI);
} catch(e) {}
state = "valid";
}
}
gURLBar.value = value;
SetPageProxyState(state);