зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
5d7e185ab4
Коммит
57f0bcd657
|
@ -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\./, ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче