Prevent overlapping tags

This commit is contained in:
RogueException
2017-03-31 15:18:35 -03:00
parent 7d1cae8ae8
commit 8dfa0220c3
2 changed files with 23 additions and 2 deletions

View File

@@ -256,6 +256,15 @@ namespace Discord
if (mode != TagHandling.Remove)
{
Emoji emoji = (Emoji)tag.Value;
//Remove if its name contains any bad chars (prevents a few tag exploits)
for (int i = 0; i < emoji.Name.Length; i++)
{
char c = emoji.Name[i];
if (!char.IsLetterOrDigit(c) && c != '_' && c != '-')
return "";
}
switch (mode)
{
case TagHandling.Name: