Bug 683422 An Ampersand (&) on the URL line breaks Translate Page r=IanN.
authorPhilip Chee <philip.chee@gmail.com>
Tue, 06 Sep 2011 00:20:19 +0800
changeset 8428 1a07f47df164f40c7945d2ad09919a3ec333fd1e
parent 8427 9eba3b1b217b8c02c394f22be2664edf431b761d
child 8429 84961292898a5dbd1599d498527501cc4f8ccc25
push id6468
push userphilip.chee@gmail.com
push dateMon, 05 Sep 2011 16:21:03 +0000
treeherdercomm-central@1a07f47df164 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs683422
Bug 683422 An Ampersand (&) on the URL line breaks Translate Page r=IanN.
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 GetTypePermFromId(aId)
 {
   // Get type and action from splitting id, first is type, second is action.
   var [type, action] = aId.split("_");
   var perm = "ACCESS_" + action.toUpperCase();