mirror of https://gitlab.com/bashrc2/epicyon
Include attachments text within filter scan of profile bio
parent
533c07d502
commit
2c295919e6
21
person.py
21
person.py
|
@ -1686,6 +1686,21 @@ def validSendingActor(session, baseDir: str,
|
||||||
return False
|
return False
|
||||||
bioStr = removeHtml(actorJson['summary'])
|
bioStr = removeHtml(actorJson['summary'])
|
||||||
bioStr += ' ' + removeHtml(actorJson['preferredUsername'])
|
bioStr += ' ' + removeHtml(actorJson['preferredUsername'])
|
||||||
|
|
||||||
|
if actorJson.get('attachment'):
|
||||||
|
if isinstance(actorJson['attachment'], list):
|
||||||
|
for tag in actorJson['attachment']:
|
||||||
|
if not isinstance(tag, dict):
|
||||||
|
continue
|
||||||
|
if not tag.get('name'):
|
||||||
|
continue
|
||||||
|
if isinstance(tag['name'], str):
|
||||||
|
bioStr += ' ' + tag['name']
|
||||||
|
if tag.get('value'):
|
||||||
|
continue
|
||||||
|
if isinstance(tag['value'], str):
|
||||||
|
bioStr += ' ' + tag['value']
|
||||||
|
|
||||||
if actorJson.get('name'):
|
if actorJson.get('name'):
|
||||||
bioStr += ' ' + removeHtml(actorJson['name'])
|
bioStr += ' ' + removeHtml(actorJson['name'])
|
||||||
if containsInvalidChars(bioStr):
|
if containsInvalidChars(bioStr):
|
||||||
|
@ -1721,12 +1736,6 @@ def validSendingActor(session, baseDir: str,
|
||||||
if len(tag['value']) < 2:
|
if len(tag['value']) < 2:
|
||||||
tagsWithoutValue += 1
|
tagsWithoutValue += 1
|
||||||
continue
|
continue
|
||||||
if containsInvalidChars(tag['name']):
|
|
||||||
tagsWithoutValue += 1
|
|
||||||
continue
|
|
||||||
if containsInvalidChars(tag['value']):
|
|
||||||
tagsWithoutValue += 1
|
|
||||||
continue
|
|
||||||
if noOfTags > 0:
|
if noOfTags > 0:
|
||||||
if int(tagsWithoutValue * 100 / noOfTags) > 50:
|
if int(tagsWithoutValue * 100 / noOfTags) > 50:
|
||||||
print('REJECT: actor has empty attachments ' +
|
print('REJECT: actor has empty attachments ' +
|
||||||
|
|
Loading…
Reference in New Issue