Check announced posts for invalid ciphertext

merge-requests/30/head
Bob Mottram 2021-11-22 12:10:23 +00:00
parent b6fda529d1
commit 44308df999
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ from webfinger import webfingerHandle
from httpsig import createSignedHeader
from siteactive import siteIsActive
from languages import understoodPostLanguage
from utils import invalidCiphertext
from utils import hasObjectStringType
from utils import removeIdEnding
from utils import replaceUsersWithAt
@ -4602,6 +4603,11 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str,
recentPostsCache)
return None
if invalidCiphertext(contentStr):
print('WARN: Invalid ciphertext within announce ' +
str(announcedJson))
return None
# remove any long words
contentStr = removeLongWords(contentStr, 40, [])