mirror of https://gitlab.com/bashrc2/epicyon
More validation
parent
5ad90d1b01
commit
c6ffdb2f83
|
@ -81,6 +81,12 @@ def announcedByPerson(postJsonObject: {}, nickname: str, domain: str) -> bool:
|
||||||
# not to be confused with shared items
|
# not to be confused with shared items
|
||||||
if not postJsonObject['object'].get('shares'):
|
if not postJsonObject['object'].get('shares'):
|
||||||
return False
|
return False
|
||||||
|
if not isinstance(postJsonObject['shares'], dict):
|
||||||
|
return False
|
||||||
|
if not postJsonObject['object']['shares'].get('items'):
|
||||||
|
return False
|
||||||
|
if not isinstance(postJsonObject['object']['shares']['items'], list):
|
||||||
|
return False
|
||||||
actorMatch = domain + '/users/' + nickname
|
actorMatch = domain + '/users/' + nickname
|
||||||
for item in postJsonObject['object']['shares']['items']:
|
for item in postJsonObject['object']['shares']['items']:
|
||||||
if item['actor'].endswith(actorMatch):
|
if item['actor'].endswith(actorMatch):
|
||||||
|
|
Loading…
Reference in New Issue