]> git.ipfire.org Git - dbl.git/commitdiff
sources: Accept "[Adblock Plus 2.0]" as a valid header
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 14:22:28 +0000 (14:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 14:22:28 +0000 (14:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index dbf5a46a66544747438e182334a06aaa54107a3e..df1384f19f0ca3c5a9db1ef3f8658cd6e258ebd1 100644 (file)
@@ -391,7 +391,11 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                        Called very early when we are detecting the format
                """
                # Check for the Adblock Plus header
-               if line == "[Adblock Plus]" or line.startswith("!") or line.startswith("||"):
+               if line in ("[Adblock Plus]", "[Adblock Plus 2.0]"):
+                       return Format.ADBLOCKPLUS
+
+               # Sometimes we don't have a header, but we will see comments or the first domain
+               elif line.startswith("!") or line.startswith("||"):
                        return Format.ADBLOCKPLUS
 
                # Is this a hosts file?