From 072481cc2b1a8ad45336cbf65741dc3fcff06f05 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Aug 2019 11:13:09 +0100 Subject: [PATCH] Check the domain looks like a domain when extracting mentions --- content.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content.py b/content.py index 7e1a46d1e..d25a0bd15 100644 --- a/content.py +++ b/content.py @@ -130,8 +130,10 @@ def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},r return True # @nick@domain if '@' in possibleHandle: + replaceDomain=possibleHandle.split('@')[1] + if not (replaceDomain=='localhost' or '.' in replaceDomain): + return False possibleNickname=possibleHandle.split('@')[0] - replaceDomain=possibleHandle.split('@')[1] recipientActor=httpPrefix+"://"+replaceDomain+"/users/"+possibleNickname if recipientActor not in recipients: recipients.append(recipientActor)