]> git.ipfire.org Git - dbl.git/commitdiff
util: Don't consider domains with a hyphen or underscore as invalid
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Dec 2025 10:20:29 +0000 (10:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Dec 2025 10:20:29 +0000 (10:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/util.py

index bed15d111e9edb92331f0d35b4a022406e825d5a..dc9b1da21df25b2051330501c36a5963456d1ff5 100644 (file)
@@ -103,7 +103,11 @@ def is_fqdn(s):
 
                # Labels my only contain alpha-numerical characters as well as dash and underscore
                for ch in label:
-                       if not ch.isalnum() or ch in "-_":
+                       if ch.isalnum():
+                               continue
+                       elif ch in "-_":
+                               continue
+                       else:
                                return False
 
        # The string cannot be an IP address