mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 23:07:54 +00:00
Sanitize user input in response messages
This commit is contained in:
parent
2b508f80e9
commit
352940abbd
7 changed files with 36 additions and 27 deletions
|
|
@ -4,6 +4,7 @@ using System.Data;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Dapper;
|
||||
using Discord;
|
||||
|
|
@ -82,6 +83,9 @@ namespace PluralKit.Bot
|
|||
argPos = num + 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string Sanitize(this string input) =>
|
||||
Regex.Replace(Regex.Replace(input, "<@[!&]?(\\d{17,19})>", "<\\@$1>"), "@(everyone|here)", "@\u200B$1");
|
||||
}
|
||||
|
||||
class PKSystemTypeReader : TypeReader
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue