Index: lib/matcher.js |
=================================================================== |
--- a/lib/matcher.js |
+++ b/lib/matcher.js |
@@ -315,34 +315,44 @@ |
matchesAnyInternal(location, typeMask, docDomain, thirdParty, sitekey, |
specificOnly) |
{ |
let candidates = location.toLowerCase().match(/[a-z0-9%]{3,}/g); |
if (candidates === null) |
candidates = []; |
candidates.push(""); |
+ let whitelistHit = null; |
let blacklistHit = null; |
+ |
for (let i = 0, l = candidates.length; i < l; i++) |
{ |
let substr = candidates[i]; |
- let result = this.whitelist._checkEntryMatch( |
- substr, location, typeMask, docDomain, thirdParty, sitekey |
+ blacklistHit = this.blacklist._checkEntryMatch( |
+ substr, location, typeMask, docDomain, thirdParty, sitekey, |
+ specificOnly |
); |
- if (result) |
- return result; |
- if (blacklistHit === null) |
+ if (blacklistHit) |
+ break; |
+ } |
+ |
+ if (blacklistHit) |
+ { |
+ for (let i = 0, l = candidates.length; i < l; i++) |
{ |
- blacklistHit = this.blacklist._checkEntryMatch( |
- substr, location, typeMask, docDomain, thirdParty, sitekey, |
- specificOnly |
+ let substr = candidates[i]; |
+ whitelistHit = this.whitelist._checkEntryMatch( |
+ substr, location, typeMask, docDomain, thirdParty, sitekey |
); |
+ if (whitelistHit) |
+ break; |
} |
} |
- return blacklistHit; |
+ |
+ return whitelistHit || blacklistHit; |
} |
/** |
* @see Matcher#matchesAny |
* @inheritdoc |
*/ |
matchesAny(location, typeMask, docDomain, thirdParty, sitekey, specificOnly) |
{ |