From 96305cee7dd7e2b35d9163625a2632c1dd5cc25a Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Wed, 14 Jun 2006 21:46:42 +0000 Subject: [PATCH] Bug 268370: missing argument when calling prompt after an engine installation fails, r=mconnor, a=dveditz git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@199896 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/components/sidebar/src/nsSidebar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/browser/components/sidebar/src/nsSidebar.js b/mozilla/browser/components/sidebar/src/nsSidebar.js index 3e6601f3387..aa7186cad1f 100644 --- a/mozilla/browser/components/sidebar/src/nsSidebar.js +++ b/mozilla/browser/components/sidebar/src/nsSidebar.js @@ -76,7 +76,7 @@ nsSidebar.prototype.nc = "http://home.netscape.com/NC-rdf#"; function sidebarURLSecurityCheck(url) { - if (url.search(/(^http:|^ftp:|^https:)/) == -1) + if (!/(^http:|^ftp:|^https:)/i.test(url)) throw "Script attempted to add sidebar panel from illegal source"; } @@ -133,17 +133,17 @@ function (engineURL, iconURL, suggestedTitle, suggestedCategory) // make sure using HTTP or HTTPS and refering to a .src file // for the engine. if (! /^https?:\/\/.+\.src$/i.test(engineURL)) - throw "Unsupported search engine URL"; + throw "Unsupported search engine URL."; // make sure using HTTP or HTTPS and refering to a // .gif/.jpg/.jpeg/.png file for the icon. if (! /^https?:\/\/.+\.(gif|jpg|jpeg|png)$/i.test(iconURL)) - throw "Unsupported search icon URL"; + throw "Unsupported search icon URL."; } catch(ex) { debug(ex); - this.promptService.alert(null, "Failed to add the search engine."); + this.promptService.alert(null, "Error", "Failed to add the search engine. " + ex); throw Components.results.NS_ERROR_INVALID_ARG; }