]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 11 Jun 2023 17:59:08 +0000 (19:59 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 11 Jun 2023 18:01:55 +0000 (20:01 +0200)
- also cut off trailing double-dot (some people cannot format their data in
  tables properly)
- a wildcat might be at the start of the string, so start checking there for it

fba/helpers/tidyup.py
fba/networks/pleroma.py

index e5f8eabe53d0d6b4a75f783b4e9f73cca76ae437..b784eebf734742cc74facf1ddf93c72b4db7488c 100644 (file)
@@ -46,8 +46,9 @@ def domain(string: str) -> str:
     # No trailing slash
     string = re.sub("\/$", "", string)
 
-    # No @ sign
+    # No @ or : sign
     string = re.sub("^\@", "", string)
+    string = string.split(":")[0]
 
     # No individual users in block lists
     string = re.sub("(.+)\@", "", string)
index 8c16f884e95629a5c734cdb3fd75b797d9da792b..186c8d4b017cbc9ccba7f892acac75fce34f9fa6 100644 (file)
@@ -98,7 +98,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
                     elif blacklist.is_blacklisted(blocked):
                         # DEBUG: print(f"DEBUG: blocked='{blocked}' is blacklisted - skipping!")
                         continue
-                    elif blocked.count("*") > 1:
+                    elif blocked.count("*") > 0:
                         # Obsured domain name with no hash
                         # DEBUG: print(f"DEBUG: Trying to de-obscure blocked='{blocked}' ...")
                         fba.cursor.execute(
@@ -185,7 +185,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
                 elif blacklist.is_blacklisted(blocked):
                     # DEBUG: print(f"DEBUG: blocked='{blocked}' is blacklisted - skipping!")
                     continue
-                elif blocked.count("*") > 1:
+                elif blocked.count("*") > 0:
                     # Obsured domain with no hash
                     # DEBUG: print(f"DEBUG: Trying to de-obscure blocked='{blocked}' ...")
                     fba.cursor.execute(