mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +00:00
fix(bot): validate url in pk;import
This commit is contained in:
parent
ac5774df3d
commit
2fea773d7e
4 changed files with 7 additions and 7 deletions
|
|
@ -36,6 +36,9 @@ public class ImportExport
|
|||
var url = ctx.RemainderOrNull() ?? ctx.Message.Attachments.FirstOrDefault()?.Url;
|
||||
if (url == null) throw Errors.NoImportFilePassed;
|
||||
|
||||
if (!Core.MiscUtils.TryMatchUri(url, out var _))
|
||||
throw Errors.InvalidUrl;
|
||||
|
||||
await ctx.BusyIndicator(async () =>
|
||||
{
|
||||
JObject data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue