Bug 327226 - www prefix can confuse the phishing detector

p=Magnus Melin <mkmelin+mozilla@iki.fi>
r=iann, sr=mscott
This commit is contained in:
asqueella%gmail.com 2007-02-20 20:33:34 +00:00
Родитель 5d7e185ab4
Коммит 57f0bcd657
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -223,7 +223,8 @@ var gPhishingDetector = {
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
aLinkTextURL.value = ioService.newURI(aLinkNodeText, null, null);
return aHrefURL.host != aLinkTextURL.value.host;
// compare hosts, but ignore possible www. prefix
return !(aHrefURL.host.replace(/^www\./, "") == aLinkTextURL.value.host.replace(/^www\./, ""));
}
}

Просмотреть файл

@ -153,7 +153,8 @@ function misMatchedHostWithLinkText(aLinkNode, aHrefURL, aLinkTextURL)
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var linkTextURL = ioService.newURI(linkNodeText, null, null);
aLinkTextURL.value = linkTextURL;
return aHrefURL.host != linkTextURL.host;
// compare hosts, but ignore possible www. prefix
return !(aHrefURL.host.replace(/^www\./, "") == aLinkTextURL.value.host.replace(/^www\./, ""));
}
}