Bug 683422 An Ampersand (&) on the URL line breaks Translate Page r=IanN a=IanN for comm-beta and comm-aurora.
authorPhilip Chee <philip.chee@gmail.com>
Tue, 06 Sep 2011 00:20:19 +0800
changeset 8431 54f2d228378ebddaac4a47f93da16e219f50b22c
parent 8430 5d79475fb1889f3f5e228836a62fc9115dd8575d
child 8432 1dcf60c84977511fea4f9750e061ab456767015b
push id111
push userphilip.chee@gmail.com
push dateTue, 06 Sep 2011 03:46:39 +0000
treeherdercomm-beta@54f2d228378e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs683422
Bug 683422 An Ampersand (&) on the URL line breaks Translate Page r=IanN a=IanN for comm-beta and comm-aurora.
suite/browser/navigator.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -830,17 +830,17 @@ function Translate()
   var service = GetLocalizedStringPref("browser.translation.service");
   var serviceDomain = GetLocalizedStringPref("browser.translation.serviceDomain");
   var targetURI = getWebNavigation().currentURI.spec;
 
   // if we're already viewing a translated page, then just reload
   if (targetURI.indexOf(serviceDomain) >= 0)
     BrowserReload();
   else {
-    loadURI(encodeURI(service + targetURI));
+    loadURI(encodeURI(service) + encodeURIComponent(targetURI));
   }
 }
 
 function OpenSessionHistoryIn(aWhere, aDelta, aTab)
 {
   var win = aWhere == "window" ? null : window;
   aTab = aTab || getBrowser().selectedTab;
   var tab = Components.classes["@mozilla.org/suite/sessionstore;1"]