From b1abfffdcf9086528b1e6dfdce937ca3c464614e Mon Sep 17 00:00:00 2001 From: bashrc Date: Tue, 5 May 2026 17:40:22 +0100 Subject: [PATCH] Check that type is a string --- art.py | 2 ++ briar.py | 4 ++++ cwtch.py | 4 ++++ discord.py | 4 ++++ donate.py | 4 ++++ enigma.py | 4 ++++ git.py | 4 ++++ lxmf.py | 4 ++++ matrix.py | 4 ++++ music.py | 4 ++++ peertube.py | 6 ++++++ pgp.py | 14 ++++++++++++++ pixelfed.py | 6 ++++++ pronouns.py | 4 ++++ ssb.py | 4 ++++ tox.py | 4 ++++ utils.py | 4 ++++ webapp_utils.py | 2 ++ webfinger.py | 2 ++ xmpp.py | 4 ++++ youtube.py | 6 ++++++ 21 files changed, 94 insertions(+) diff --git a/art.py b/art.py index 2884b950b..eaf8175b7 100644 --- a/art.py +++ b/art.py @@ -126,6 +126,8 @@ def set_art_site_url(actor_json: {}, art_site_url: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, art_fieldnames): continue diff --git a/briar.py b/briar.py index b644e4158..b80c14fb5 100644 --- a/briar.py +++ b/briar.py @@ -36,6 +36,8 @@ def get_briar_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, prop_value = \ get_attachment_property_value(property_value) if not prop_value: @@ -126,6 +128,8 @@ def set_briar_address(actor_json: {}, briar_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('briar'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/cwtch.py b/cwtch.py index 3a8e57d06..4b4a89cf0 100644 --- a/cwtch.py +++ b/cwtch.py @@ -36,6 +36,8 @@ def get_cwtch_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, prop_value = \ get_attachment_property_value(property_value) if not prop_value: @@ -114,6 +116,8 @@ def set_cwtch_address(actor_json: {}, cwtch_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('cwtch'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/discord.py b/discord.py index 7e7a107a5..5bf000968 100644 --- a/discord.py +++ b/discord.py @@ -39,6 +39,8 @@ def get_discord(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -96,6 +98,8 @@ def set_discord(actor_json: {}, discord: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, discord_fieldnames): continue diff --git a/donate.py b/donate.py index 680873611..f46df5707 100644 --- a/donate.py +++ b/donate.py @@ -59,6 +59,8 @@ def get_donation_url(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, prop_value = \ get_attachment_property_value(property_value) if not prop_value: @@ -151,6 +153,8 @@ def set_donation_url(actor_json: {}, donate_url: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if name_value.lower() != donate_name: continue if not property_value['type'].endswith('PropertyValue'): diff --git a/enigma.py b/enigma.py index 7d8ff5690..0c13dfde9 100644 --- a/enigma.py +++ b/enigma.py @@ -36,6 +36,8 @@ def get_enigma_pub_key(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -97,6 +99,8 @@ def set_enigma_pub_key(actor_json: {}, enigma_pub_key: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('enigma'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/git.py b/git.py index 2530853de..313b082ec 100644 --- a/git.py +++ b/git.py @@ -253,6 +253,8 @@ def get_repo_url(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, prop_value = \ get_attachment_property_value(property_value) if not prop_value: @@ -278,6 +280,8 @@ def get_repo_url(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, prop_value = \ get_attachment_property_value(property_value) if not prop_value: diff --git a/lxmf.py b/lxmf.py index 799cef485..394c33896 100644 --- a/lxmf.py +++ b/lxmf.py @@ -85,6 +85,8 @@ def get_lxmf_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -171,6 +173,8 @@ def set_lxmf_address(base_dir: str, nickname: str, domain: str, continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('lxmf'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/matrix.py b/matrix.py index fff61d0dd..f18d3e20c 100644 --- a/matrix.py +++ b/matrix.py @@ -41,6 +41,8 @@ def get_matrix_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -130,6 +132,8 @@ def set_matrix_address(actor_json: {}, matrix_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('matrix'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/music.py b/music.py index b972fe006..4505475c7 100644 --- a/music.py +++ b/music.py @@ -37,6 +37,8 @@ def get_music_site_url(actor_json: {}) -> str: continue if not isinstance(property_value['type'], str): continue + if not isinstance(property_value['type'], str): + continue if not property_value['type'].endswith('PropertyValue'): continue prop_value_name, _ = \ @@ -102,6 +104,8 @@ def set_music_site_url(actor_json: {}, music_site_url: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, music_fieldnames): continue diff --git a/peertube.py b/peertube.py index c8b500c23..6913e9c91 100644 --- a/peertube.py +++ b/peertube.py @@ -39,6 +39,8 @@ def get_peertube(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -54,6 +56,8 @@ def get_peertube(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -113,6 +117,8 @@ def set_peertube(actor_json: {}, peertube: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, peertube_fieldnames): continue diff --git a/pgp.py b/pgp.py index e36d49ef8..f86b641f1 100644 --- a/pgp.py +++ b/pgp.py @@ -71,6 +71,8 @@ def get_email_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -121,6 +123,8 @@ def get_deltachat_invite(actor_json: {}, translate: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -157,6 +161,8 @@ def get_pgp_pub_key(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -191,6 +197,8 @@ def get_pgp_fingerprint(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -260,6 +268,8 @@ def set_email_address(actor_json: {}, email_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('email'): continue if not property_value['type'].endswith('PropertyValue'): @@ -385,6 +395,8 @@ def set_pgp_pub_key(actor_json: {}, pgp_pub_key: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('pgp'): continue if not property_value['type'].endswith('PropertyValue'): @@ -458,6 +470,8 @@ def set_pgp_fingerprint(actor_json: {}, fingerprint: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('openpgp'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/pixelfed.py b/pixelfed.py index 4b8bbd724..f7916f218 100644 --- a/pixelfed.py +++ b/pixelfed.py @@ -43,6 +43,8 @@ def get_pixelfed(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -75,6 +77,8 @@ def get_pixelfed(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -136,6 +140,8 @@ def set_pixelfed(actor_json: {}, pixelfed: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, pixelfed_fieldnames): continue diff --git a/pronouns.py b/pronouns.py index e2b3ef4d7..6f70c641f 100644 --- a/pronouns.py +++ b/pronouns.py @@ -39,6 +39,8 @@ def get_pronouns(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -96,6 +98,8 @@ def set_pronouns(actor_json: {}, pronouns: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, pronoun_fieldnames): continue diff --git a/ssb.py b/ssb.py index f1a3382d4..3acb6254c 100644 --- a/ssb.py +++ b/ssb.py @@ -36,6 +36,8 @@ def get_ssb_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -119,6 +121,8 @@ def set_ssb_address(actor_json: {}, ssb_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('ssb'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/tox.py b/tox.py index 1f6827d1a..638764dbb 100644 --- a/tox.py +++ b/tox.py @@ -36,6 +36,8 @@ def get_tox_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -125,6 +127,8 @@ def set_tox_address(actor_json: {}, tox_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith('tox'): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/utils.py b/utils.py index a58e850ee..e148dbc12 100644 --- a/utils.py +++ b/utils.py @@ -194,6 +194,8 @@ def get_actor_languages_list(actor_json: {}) -> []: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -2890,6 +2892,8 @@ def get_actor_property_url(actor_json: {}, property_name: str) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: diff --git a/webapp_utils.py b/webapp_utils.py index 8af0b4b6a..afe2374d9 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -359,6 +359,8 @@ def _set_actor_property_url(actor_json: {}, continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue if not name_value.lower().startswith(property_name_lower): continue if not property_value['type'].endswith('PropertyValue'): diff --git a/webfinger.py b/webfinger.py index 7d4000772..9ae6b4214 100644 --- a/webfinger.py +++ b/webfinger.py @@ -571,6 +571,8 @@ def _webfinger_update_from_profile(wf_json: {}, actor_json: {}) -> bool: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: diff --git a/xmpp.py b/xmpp.py index 2195c53a5..9a8f0a2c3 100644 --- a/xmpp.py +++ b/xmpp.py @@ -38,6 +38,8 @@ def get_xmpp_address(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -128,6 +130,8 @@ def set_xmpp_address(actor_json: {}, xmpp_address: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not (name_value.startswith('xmpp') or name_value.startswith('jabber') or diff --git a/youtube.py b/youtube.py index a3699c6e6..6dce3cdf2 100644 --- a/youtube.py +++ b/youtube.py @@ -39,6 +39,8 @@ def get_youtube(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -54,6 +56,8 @@ def get_youtube(actor_json: {}) -> str: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue prop_value_name, _ = \ get_attachment_property_value(property_value) if not prop_value_name: @@ -114,6 +118,8 @@ def set_youtube(actor_json: {}, youtube: str) -> None: continue if not property_value.get('type'): continue + if not isinstance(property_value['type'], str): + continue name_value = name_value.lower() if not string_contains(name_value, youtube_fieldnames): continue