From 04b974160bf1ce3cfa35a936b8a0a5c7ba14efec Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 12 Aug 2024 21:39:31 +0100 Subject: [PATCH] Remove html fluff from urls --- utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils.py b/utils.py index a45d64409..ed8bca9d3 100644 --- a/utils.py +++ b/utils.py @@ -4134,19 +4134,20 @@ def get_actor_property_url(actor_json: {}, property_name: str) -> str: property_value['value'] = property_value[prop_value_name].strip() prefixes = get_protocol_prefixes() prefix_found = False + prop_value = remove_html(property_value[prop_value_name]) for prefix in prefixes: - if property_value[prop_value_name].startswith(prefix): + if prop_value.startswith(prefix): prefix_found = True break if not prefix_found: continue - if '.' not in property_value[prop_value_name]: + if '.' not in prop_value: continue - if ' ' in property_value[prop_value_name]: + if ' ' in prop_value: continue - if ',' in property_value[prop_value_name]: + if ',' in prop_value: continue - return property_value[prop_value_name] + return prop_value return ''