From 2745ee61564ef0694d5bae29eea771eaa982d3cd Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 17 Nov 2022 00:44:00 +0000 Subject: [PATCH] fix(bot): check proxy tag length when overwriting --- PluralKit.Bot/Commands/MemberProxy.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PluralKit.Bot/Commands/MemberProxy.cs b/PluralKit.Bot/Commands/MemberProxy.cs index 5e6bbbaa..953d53d8 100644 --- a/PluralKit.Bot/Commands/MemberProxy.cs +++ b/PluralKit.Bot/Commands/MemberProxy.cs @@ -114,6 +114,10 @@ public class MemberProxy throw Errors.GenericCancelled(); } + if (requestedTag.ProxyString.Length > Limits.MaxProxyTagLength) + throw new PKError( + $"Proxy tag too long ({requestedTag.ProxyString.Length} > {Limits.MaxProxyTagLength} characters)."); + if (!await WarnOnConflict(requestedTag)) throw Errors.GenericCancelled();