diff --git a/src/lib/adblock/adblockrule.cpp b/src/lib/adblock/adblockrule.cpp index 278b07259..05a2db2ef 100644 --- a/src/lib/adblock/adblockrule.cpp +++ b/src/lib/adblock/adblockrule.cpp @@ -47,9 +47,9 @@ #include "adblockrule.h" #include "adblocksubscription.h" #include "qztools.h" +#include "qzregexp.h" #include -#include "qzregexp.h" #include #include #include @@ -362,6 +362,7 @@ void AdBlockRule::parseFilter() // Empty rule or just comment if (m_filter.trimmed().isEmpty() || m_filter.startsWith(QLatin1Char('!'))) { m_isEnabled = false; + m_type = Invalid; return; } @@ -445,6 +446,7 @@ void AdBlockRule::parseFilter() // If we don't handle all options, it's safer to just disable this rule if (handledOptions != options.count()) { m_isInternalDisabled = true; + m_type = Invalid; return; } diff --git a/src/lib/adblock/adblockrule.h b/src/lib/adblock/adblockrule.h index 5ea2c952d..4fc0b22aa 100644 --- a/src/lib/adblock/adblockrule.h +++ b/src/lib/adblock/adblockrule.h @@ -106,7 +106,8 @@ private: DomainMatchRule = 1, RegExpMatchRule = 2, StringEndsMatchRule = 3, - StringContainsMatchRule = 4 + StringContainsMatchRule = 4, + Invalid = 5 }; enum RuleOption { @@ -153,6 +154,8 @@ private: QStringList m_allowedDomains; QStringList m_blockedDomains; + + friend class AdBlockSearchTree; }; #endif // ADBLOCKRULE_H