mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 19:09:47 +00:00
Bug 550290: addSearchEngine/AddSearchProvider icon validity check is bogus, r=Ryan
--HG-- extra : rebase_source : 5971de13c8049e69ea9d868ac4ebdfb7ffe3dc96
This commit is contained in:
parent
c25527a334
commit
3f378a44cc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user