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

Side by Side Diff: lib/matcher.js

Issue 29996555: Noissue - Lower-case URL in advance for location-only filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Feb. 2, 2019, 5:33 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 checkEntryMatch(keyword, location, typeMask, docDomain, thirdParty, sitekey, 310 checkEntryMatch(keyword, location, typeMask, docDomain, thirdParty, sitekey,
311 specificOnly, collection) 311 specificOnly, collection)
312 { 312 {
313 // We need to skip the simple (location-only) filters if the type mask does 313 // We need to skip the simple (location-only) filters if the type mask does
314 // not contain any default content types. 314 // not contain any default content types.
315 if ((typeMask & DEFAULT_TYPES) != 0) 315 if ((typeMask & DEFAULT_TYPES) != 0)
316 { 316 {
317 let simpleSet = this._simpleFiltersByKeyword.get(keyword); 317 let simpleSet = this._simpleFiltersByKeyword.get(keyword);
318 if (simpleSet) 318 if (simpleSet)
319 { 319 {
320 let lowerCaseLocation = location.toLowerCase();
321
320 for (let filter of simpleSet) 322 for (let filter of simpleSet)
321 { 323 {
322 if (specificOnly && !(filter instanceof WhitelistFilter)) 324 if (specificOnly && !(filter instanceof WhitelistFilter))
323 continue; 325 continue;
324 326
325 if (filter.matchesLocation(location)) 327 if (filter.matchesLocation(location, lowerCaseLocation))
326 { 328 {
327 if (!collection) 329 if (!collection)
328 return filter; 330 return filter;
329 331
330 collection.push(filter); 332 collection.push(filter);
331 } 333 }
332 } 334 }
333 } 335 }
334 } 336 }
335 337
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 684
683 exports.CombinedMatcher = CombinedMatcher; 685 exports.CombinedMatcher = CombinedMatcher;
684 686
685 /** 687 /**
686 * Shared {@link CombinedMatcher} instance that should usually be used. 688 * Shared {@link CombinedMatcher} instance that should usually be used.
687 * @type {CombinedMatcher} 689 * @type {CombinedMatcher}
688 */ 690 */
689 let defaultMatcher = new CombinedMatcher(); 691 let defaultMatcher = new CombinedMatcher();
690 692
691 exports.defaultMatcher = defaultMatcher; 693 exports.defaultMatcher = defaultMatcher;
OLDNEW
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld