From: Roland Häder Date: Sun, 11 Jun 2023 17:59:08 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5620e4be5b6d83f80e97b516468698390032b219;p=fba.git Continued: - 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 --- diff --git a/fba/helpers/tidyup.py b/fba/helpers/tidyup.py index e5f8eab..b784eeb 100644 --- a/fba/helpers/tidyup.py +++ b/fba/helpers/tidyup.py @@ -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) diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index 8c16f88..186c8d4 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -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(