From 94cd02b7d04c55e17c85faf5de7d83f92ede8d50 Mon Sep 17 00:00:00 2001 From: "dveditz%cruzio.com" Date: Wed, 21 Jun 2006 06:51:11 +0000 Subject: [PATCH] bug 342205 (SeaMonkey version of 268370) prevent leaks of install-dir from nsSidebar exceptions. merged gavin's Firefox patch, r=mconnor, a=kairo and iann. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@200502 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/components/sidebar/src/nsSidebar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mozilla/xpfe/components/sidebar/src/nsSidebar.js b/mozilla/xpfe/components/sidebar/src/nsSidebar.js index 95c06f6cc68..1b215c1e945 100644 --- a/mozilla/xpfe/components/sidebar/src/nsSidebar.js +++ b/mozilla/xpfe/components/sidebar/src/nsSidebar.js @@ -106,7 +106,7 @@ function (aContentURL) 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"; } @@ -262,7 +262,7 @@ function (engineURL, iconURL, suggestedTitle, suggestedCategory) 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."); throw Components.results.NS_ERROR_INVALID_ARG; }