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 patch. Created March 6, 2018, 7:32 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 type[i] = (item.first[i] == '-' ? '_' : toupper(item.first[i])); 356 type[i] = (item.first[i] == '-' ? '_' : toupper(item.first[i]));
357 printf(" %s: %i,\n", type.c_str(), item.second); 357 printf(" %s: %i,\n", type.c_str(), item.second);
358 } 358 }
359 printf("};\n"); 359 printf("};\n");
360 } 360 }
361 361
362 RegExpFilter::DomainMap* RegExpFilter::GetDomains() const 362 RegExpFilter::DomainMap* RegExpFilter::GetDomains() const
363 { 363 {
364 if (!mData.DomainsParsingDone()) 364 if (!mData.DomainsParsingDone())
365 { 365 {
366 ParseDomains(mData.GetDomainsSource(mText), u'|'); 366 ParseDomains(mData.GetDomainsSource(mText), u'|', true);
367 mData.SetDomainsParsingDone(); 367 mData.SetDomainsParsingDone();
368 } 368 }
369 return ActiveFilter::GetDomains(); 369 return ActiveFilter::GetDomains();
370 } 370 }
371 371
372 RegExpFilter::SitekeySet* RegExpFilter::GetSitekeys() const 372 RegExpFilter::SitekeySet* RegExpFilter::GetSitekeys() const
373 { 373 {
374 if (!mData.SitekeyParsingDone()) 374 if (!mData.SitekeyParsingDone())
375 { 375 {
376 ParseSitekeys(mData.GetSitekeysSource(mText)); 376 ParseSitekeys(mData.GetSitekeysSource(mText));
(...skipping 13 matching lines...) Expand all
390 return false; 390 return false;
391 } 391 }
392 392
393 if (!mData.RegExpParsingDone()) 393 if (!mData.RegExpParsingDone())
394 { 394 {
395 const OwnedString pattern(mData.GetRegExpSource(mText)); 395 const OwnedString pattern(mData.GetRegExpSource(mText));
396 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ; 396 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ;
397 } 397 }
398 return TestRegExp(mData.mRegexpId, location); 398 return TestRegExp(mData.mRegexpId, location);
399 } 399 }
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