Index: compiled/filter/Filter.cpp |
=================================================================== |
--- a/compiled/filter/Filter.cpp |
+++ b/compiled/filter/Filter.cpp |
@@ -102,21 +102,22 @@ |
// Parsing also normalizes the filter text, so it has to be done before the |
// lookup in knownFilters. |
union |
{ |
RegExpFilterData regexp; |
ElemHideData elemhide; |
} data; |
bool needConversion = false; |
+ ParsedDomains parsedDomains; |
DependentString error; |
Filter::Type type = CommentFilter::Parse(text); |
if (type == Filter::Type::UNKNOWN) |
- type = ElemHideBase::Parse(text, data.elemhide, needConversion); |
+ type = ElemHideBase::Parse(text, error, data.elemhide, needConversion, parsedDomains); |
if (type == Filter::Type::UNKNOWN) |
type = RegExpFilter::Parse(text, error, data.regexp); |
if (needConversion && (type == ElemHideException::classType || type == ElemHideEmulationFilter::classType)) |
text = ElemHideBase::ConvertFilter(text, data.elemhide.mSelectorStart); |
// At that point we failed the conversion. |
if (text.empty()) |
@@ -140,23 +141,24 @@ |
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; |
} |