Index: compiled/filter/Filter.cpp |
=================================================================== |
--- a/compiled/filter/Filter.cpp |
+++ b/compiled/filter/Filter.cpp |
@@ -99,21 +99,22 @@ |
// Parsing also normalizes the filter text, so it has to be done before the |
// lookup in knownFilters. |
union |
{ |
RegExpFilterData regexp; |
ElemHideData elemhide; |
} data; |
+ ParsedDomains parsedDomains; |
DependentString error; |
Filter::Type type = CommentFilter::Parse(text); |
if (type == Filter::Type::UNKNOWN) |
- type = ElemHideBase::Parse(text, data.elemhide); |
+ type = ElemHideBase::Parse(text, error, data.elemhide, parsedDomains); |
if (type == Filter::Type::UNKNOWN) |
type = RegExpFilter::Parse(text, error, data.regexp); |
auto knownFilter = knownFilters.find(text); |
if (knownFilter) |
{ |
knownFilter->second->AddRef(); |
return knownFilter->second; |
@@ -130,23 +131,26 @@ |
break; |
case BlockingFilter::classType: |
filter = FilterPtr(new BlockingFilter(text, data.regexp), false); |
break; |
case WhitelistFilter::classType: |
filter = FilterPtr(new WhitelistFilter(text, data.regexp), false); |
break; |
case ElemHideFilter::classType: |
- filter = FilterPtr(new ElemHideFilter(text, data.elemhide), false); |
+ filter = FilterPtr(new ElemHideFilter(text, data.elemhide, |
+ parsedDomains), false); |
break; |
case ElemHideException::classType: |
- filter = FilterPtr(new ElemHideException(text, data.elemhide), false); |
+ filter = FilterPtr(new ElemHideException(text, data.elemhide, |
+ parsedDomains), false); |
break; |
case ElemHideEmulationFilter::classType: |
- filter = FilterPtr(new ElemHideEmulationFilter(text, data.elemhide), false); |
+ filter = FilterPtr(new ElemHideEmulationFilter(text, data.elemhide, |
+ parsedDomains), false); |
if (static_cast<ElemHideEmulationFilter*>(filter.get())->IsGeneric()) |
filter = FilterPtr(new InvalidFilter(text, u"filter_elemhideemulation_nodomain"_str), false); |
break; |
default: |
// This should never happen but just in case |
return nullptr; |
} |