From f0354a101a7d9b7116a14321eabaac322142c0dd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Jan 2023 17:15:19 +0000 Subject: [PATCH] Ensure that license and creator text is not too long --- webapp_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index fe68816a0..fdea01ef0 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -1240,13 +1240,18 @@ def get_post_attachments_as_html(base_dir: str, if not is_filtered(base_dir, nickname, domain, attach['schema:license'], system_language): - media_license = attach['schema:license'] + if '://' not in attach['schema:license']: + if len(attach['schema:license']) < 60: + media_license = attach['schema:license'] + else: + media_license = attach['schema:license'] media_creator = '' if attach.get('schema:creator'): if not is_filtered(base_dir, nickname, domain, attach['schema:creator'], system_language): - media_creator = attach['schema:creator'] + if len(attach['schema:creator']) < 60: + media_creator = attach['schema:creator'] media_type = attach['mediaType'] image_description = ''