Email actor attachment validation

merge-requests/30/head
Bob Mottram 2023-09-08 11:28:46 +01:00
parent cac51de657
commit 58761260eb
1 changed files with 8 additions and 4 deletions

10
pgp.py
View File

@ -48,6 +48,7 @@ def get_email_address(actor_json: {}) -> str:
if not name_value: if not name_value:
continue continue
if not name_value.lower().startswith('email'): if not name_value.lower().startswith('email'):
if 'Mail' not in name_value:
continue continue
if not property_value.get('type'): if not property_value.get('type'):
continue continue
@ -57,11 +58,14 @@ def get_email_address(actor_json: {}) -> str:
continue continue
if not property_value['type'].endswith('PropertyValue'): if not property_value['type'].endswith('PropertyValue'):
continue continue
if '@' not in property_value[prop_value_name]: value_str = remove_html(property_value[prop_value_name])
if '://' in value_str:
continue continue
if '.' not in property_value[prop_value_name]: if '@' not in value_str:
continue continue
return remove_html(property_value[prop_value_name]) if '.' not in value_str:
continue
return value_str
return '' return ''