diff --git a/webapp_utils.py b/webapp_utils.py index 42d204f29..d8c77e11e 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -1371,8 +1371,9 @@ def get_post_attachments_as_html(base_dir: str, # avoid displaying very long domains if len(chat_domain_str) > 50: chat_domain_str = '' + chat_url = remove_html(attach['href']) attachment_str += \ - '
' + \ '💬 ' + translate['Chat'] + chat_domain_str + '
' @@ -1400,7 +1401,7 @@ def get_post_attachments_as_html(base_dir: str, elif attach.get('href'): url = attach['href'] if name and url: - transcripts[name] = url + transcripts[name] = remove_html(url) for attach in post_json_object['object']['attachment']: if not (attach.get('mediaType') and attach.get('url')): @@ -1449,7 +1450,7 @@ def get_post_attachments_as_html(base_dir: str, image_description = attach['name'].replace('"', "'") image_description = remove_html(image_description) if _is_image_mime_type(media_type): - image_url = attach['url'] + image_url = remove_html(attach['url']) # display svg images if they have first been rendered harmless svg_harmless = True @@ -1468,7 +1469,7 @@ def get_post_attachments_as_html(base_dir: str, if os.path.isfile(cached_svg_filename): svg_harmless = True - if _is_attached_image(attach['url']) and svg_harmless: + if _is_attached_image(image_url) and svg_harmless: if not attachment_str: attachment_str += '