Bug 550290: addSearchEngine/AddSearchProvider icon validity check is bogus, r=Ryan

--HG--
extra : rebase_source : 5971de13c8049e69ea9d868ac4ebdfb7ffe3dc96
This commit is contained in:
Gavin Sharp 2010-03-23 17:23:45 -04:00
parent c25527a334
commit 3f378a44cc

View File

@ -137,14 +137,13 @@ function (engineURL, iconURL)
{
try
{
// Make sure we're using HTTP, HTTPS, or FTP.
if (! /^(https?|ftp):\/\//i.test(engineURL))
// Make sure the URLs are HTTP, HTTPS, or FTP.
var isWeb = /^(https?|ftp):\/\//i;
if (!isWeb.test(engineURL))
throw "Unsupported search engine URL";
// Make sure we're using HTTP, HTTPS, or FTP and refering to a
// .gif/.jpg/.jpeg/.png/.ico file for the icon.
if (iconURL &&
! /^(https?|ftp):\/\/.+\.(gif|jpg|jpeg|png|ico)$/i.test(iconURL))
if (iconURL && !isWeb.test(iconURL))
throw "Unsupported search icon URL.";
}
catch(ex)