From d3fc9ee45ed9c42230e7797a861eb02ba4f3e8bb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 15 Sep 2021 20:48:01 +0100 Subject: [PATCH] Validate hashtag name --- inbox.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inbox.py b/inbox.py index 700f58245..e5ba6f79c 100644 --- a/inbox.py +++ b/inbox.py @@ -97,6 +97,7 @@ from announce import isSelfAnnounce from announce import createAnnounce from notifyOnPost import notifyWhenPersonPosts from conversation import updateConversation +from content import validHashTag def storeHashTags(baseDir: str, nickname: str, postJsonObject: {}) -> None: @@ -132,6 +133,8 @@ def storeHashTags(baseDir: str, nickname: str, postJsonObject: {}) -> None: if not tag.get('name'): continue tagName = tag['name'].replace('#', '').strip() + if not validHashTag(tagName): + continue tagsFilename = tagsDir + '/' + tagName + '.txt' postUrl = removeIdEnding(postJsonObject['id']) postUrl = postUrl.replace('/', '#')