diff --git a/app/activitypub/util.py b/app/activitypub/util.py index c82f702d..47ca6a63 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -1619,7 +1619,7 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json else: return None else: - title = request_json['object']['name'] + title = request_json['object']['name'].strip() nsfl_in_title = '[NSFL]' in title.upper() or '(NSFL)' in title.upper() post = Post(user_id=user.id, community_id=community.id, @@ -1658,9 +1658,9 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json if microblog: autogenerated_title = microblog_content_to_title(post.body_html) if len(autogenerated_title) < 20: - title = '[Microblog] ' + autogenerated_title + title = '[Microblog] ' + autogenerated_title.strip() else: - title = autogenerated_title + title = autogenerated_title.strip() if '[NSFL]' in title.upper() or '(NSFL)' in title.upper(): post.nsfl = True if '[NSFW]' in title.upper() or '(NSFW)' in title.upper():