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

Side by Side Diff: compiled/filter/RegExpFilter.cpp

Issue 29600641: Issue 5175 - Reject element hiding filter with empty domain names (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebased Created Dec. 5, 2017, 6:06 p.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 | « compiled/filter/Filter.cpp ('k') | test/filterClasses.js » ('j') | 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 type[i] = (item.first[i] == '-' ? '_' : toupper(item.first[i])); 354 type[i] = (item.first[i] == '-' ? '_' : toupper(item.first[i]));
355 printf(" %s: %i,\n", type.c_str(), item.second); 355 printf(" %s: %i,\n", type.c_str(), item.second);
356 } 356 }
357 printf("};\n"); 357 printf("};\n");
358 } 358 }
359 359
360 RegExpFilter::DomainMap* RegExpFilter::GetDomains() const 360 RegExpFilter::DomainMap* RegExpFilter::GetDomains() const
361 { 361 {
362 if (!mData.DomainsParsingDone()) 362 if (!mData.DomainsParsingDone())
363 { 363 {
364 ParseDomains(mData.GetDomainsSource(mText), u'|'); 364 ParseDomains(mData.GetDomainsSource(mText), u'|', true);
365 mData.SetDomainsParsingDone(); 365 mData.SetDomainsParsingDone();
366 } 366 }
367 return ActiveFilter::GetDomains(); 367 return ActiveFilter::GetDomains();
368 } 368 }
369 369
370 RegExpFilter::SitekeySet* RegExpFilter::GetSitekeys() const 370 RegExpFilter::SitekeySet* RegExpFilter::GetSitekeys() const
371 { 371 {
372 if (!mData.SitekeyParsingDone()) 372 if (!mData.SitekeyParsingDone())
373 { 373 {
374 ParseSitekeys(mData.GetSitekeysSource(mText)); 374 ParseSitekeys(mData.GetSitekeysSource(mText));
(...skipping 13 matching lines...) Expand all
388 return false; 388 return false;
389 } 389 }
390 390
391 if (!mData.RegExpParsingDone()) 391 if (!mData.RegExpParsingDone())
392 { 392 {
393 const OwnedString pattern(mData.GetRegExpSource(mText)); 393 const OwnedString pattern(mData.GetRegExpSource(mText));
394 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ; 394 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ;
395 } 395 }
396 return TestRegExp(mData.mRegexpId, location); 396 return TestRegExp(mData.mRegexpId, location);
397 } 397 }
OLDNEW
« no previous file with comments | « compiled/filter/Filter.cpp ('k') | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld