Skip to content

Commit

Permalink
Extract the first 3 chars during 3pid obfuscation, not just the 3rd c…
Browse files Browse the repository at this point in the history
…har (#317)

This is a duplicate of #316 for mainline which fixed the same bug on `dinsic`. The bug originally stemmed from #311.
  • Loading branch information
anoadragon453 authored Oct 14, 2020
1 parent 66abd5b commit 0f826b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/317.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a regression in v2.2.0 where the wrong characters would be obfuscated in a 3pid invite.
2 changes: 1 addition & 1 deletion sydent/http/servlets/store_invite_servlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _redact(self, s, characters_to_reveal):
# If the string is shorter than the defined threshold, redact based on length
if len(s) <= characters_to_reveal:
if len(s) > 5:
return s[3] + u"..."
return s[:3] + u"..."
if len(s) > 1:
return s[0] + u"..."
return u"..."
Expand Down

0 comments on commit 0f826b6

Please sign in to comment.