Safer display of parameters on person options screen

main
Bob Mottram 2023-07-13 09:39:35 +01:00
parent 6ecfae610c
commit 44892474c8
11 changed files with 23 additions and 15 deletions

View File

@ -951,7 +951,7 @@ def get_blog_address(actor_json: {}) -> str:
result = get_actor_property_url(actor_json, 'Blog')
if not result:
result = get_actor_property_url(actor_json, 'My Blog')
return result
return remove_html(result)
def account_has_blog(base_dir: str, nickname: str, domain: str) -> bool:

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_briar_address(actor_json: {}) -> str:
@ -50,7 +51,7 @@ def get_briar_address(actor_json: {}) -> str:
continue
if '.' in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
import re
from utils import get_attachment_property_value
from utils import remove_html
def get_cwtch_address(actor_json: {}) -> str:
@ -46,7 +47,7 @@ def get_cwtch_address(actor_json: {}) -> str:
continue
if '.' in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

View File

@ -8958,7 +8958,7 @@ class PubServer(BaseHTTPRequestHandler):
pgp_pub_key = get_pgp_pub_key(actor_json)
pgp_fingerprint = get_pgp_fingerprint(actor_json)
if actor_json.get('alsoKnownAs'):
also_known_as = actor_json['alsoKnownAs']
also_known_as = remove_html(actor_json['alsoKnownAs'])
access_keys = self.server.access_keys
nickname = 'instance'

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def _get_donation_types() -> []:
@ -54,7 +55,7 @@ def get_donation_url(actor_json: {}) -> str:
donate_url = property_value[prop_value_name].split('<a href="')[1]
if '"' in donate_url:
donate_url = donate_url.split('"')[0]
return donate_url
return remove_html(donate_url)
return ''
@ -83,7 +84,7 @@ def get_website(actor_json: {}, translate: {}) -> str:
continue
if not property_value['type'].endswith('PropertyValue'):
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''
@ -111,7 +112,7 @@ def get_gemini_link(actor_json: {}, translate: {}) -> str:
continue
if not property_value['type'].endswith('PropertyValue'):
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_enigma_pub_key(actor_json: {}) -> str:
@ -34,7 +35,7 @@ def get_enigma_pub_key(actor_json: {}) -> str:
continue
if not property_value['type'].endswith('PropertyValue'):
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_matrix_address(actor_json: {}) -> str:
@ -42,7 +43,7 @@ def get_matrix_address(actor_json: {}) -> str:
continue
if '"' in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

6
pgp.py
View File

@ -61,7 +61,7 @@ def get_email_address(actor_json: {}) -> str:
continue
if '.' not in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''
@ -90,7 +90,7 @@ def get_pgp_pub_key(actor_json: {}) -> str:
continue
if not contains_pgp_public_key(property_value[prop_value_name]):
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''
@ -119,7 +119,7 @@ def get_pgp_fingerprint(actor_json: {}) -> str:
continue
if len(property_value[prop_value_name]) < 10:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

3
ssb.py
View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_ssb_address(actor_json: {}) -> str:
@ -46,7 +47,7 @@ def get_ssb_address(actor_json: {}) -> str:
continue
if ',' in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

3
tox.py
View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_tox_address(actor_json: {}) -> str:
@ -49,7 +50,7 @@ def get_tox_address(actor_json: {}) -> str:
continue
if '.' in property_value[prop_value_name]:
continue
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''

View File

@ -9,6 +9,7 @@ __module_group__ = "Profile Metadata"
from utils import get_attachment_property_value
from utils import remove_html
def get_xmpp_address(actor_json: {}) -> str:
@ -44,7 +45,7 @@ def get_xmpp_address(actor_json: {}) -> str:
if property_value[prop_value_name].startswith('xmpp://'):
property_value[prop_value_name] = \
property_value[prop_value_name].split('xmpp://', 1)[1]
return property_value[prop_value_name]
return remove_html(property_value[prop_value_name])
return ''