Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/filterClasses.js

Issue 30000594: Noissue - Check domains first for regular expression filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Feb. 6, 2019, 4:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterClasses.js
===================================================================
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -865,18 +865,20 @@
* request
* @param {string} [sitekey] public key provided by the document
* @return {boolean} true in case of a match
*/
matches(location, typeMask, docDomain, thirdParty, sitekey)
{
return (this.contentType & typeMask) != 0 &&
(this.thirdParty == null || this.thirdParty == thirdParty) &&
- this.matchesLocation(location) &&
- this.isActiveOnDomain(docDomain, sitekey);
+ (this.regexp ? (this.isActiveOnDomain(docDomain, sitekey) &&
+ this.matchesLocation(location)) :
+ (this.matchesLocation(location) &&
+ this.isActiveOnDomain(docDomain, sitekey)));
},
/**
* Checks whether the given URL matches this filter's pattern.
* @param {string} location The URL to check.
* @param {?string} [lowerCaseLocation] The lower-case version of the URL to
* check, for case-insensitive matching.
* @returns {boolean} <code>true</code> if the URL matches.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld