bug 380912 - handle homepage urls with pipes properly when clicking 'get me out of here'. r=gavin
authormattwillis@gmail.com
Wed, 23 May 2007 09:23:09 -0700
changeset 1783 8d4c0f5e18634a46f94cebad8502a900ca6e73a5
parent 1782 4650da9584feb645ebc880ca7af8b51f4e678604
child 1784 b747262165276562bd6916367e6a44059889523e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs380912
milestone1.9a5pre
bug 380912 - handle homepage urls with pipes properly when clicking 'get me out of here'. r=gavin
browser/components/safebrowsing/content/phishing-afterload-displayer.js
--- a/browser/components/safebrowsing/content/phishing-afterload-displayer.js
+++ b/browser/components/safebrowsing/content/phishing-afterload-displayer.js
@@ -167,16 +167,20 @@ PROT_PhishMsgDisplayerBase.prototype.get
   // Try to get their homepage from prefs.
   var prefs = Cc["@mozilla.org/preferences-service;1"]
               .getService(Ci.nsIPrefService).getDefaultBranch(null);
 
   var url = "about:blank";
   try {
     url = prefs.getComplexValue("browser.startup.homepage",
                                 Ci.nsIPrefLocalizedString).data;
+    // If url is a pipe-delimited set of pages, just take the first one.
+    // This will need to change once bug 221445 is fixed.
+    if (url.indexOf("|") != -1)
+      url = url.split("|")[0];
   } catch(e) {
     G_Debug(this, "Couldn't get homepage pref: " + e);
   }
   
   return url;
 }
 
 /**