mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 08:40:11 +00:00
fix: check if member target is 5-length alpha before trying to search by HID (#441)
This commit is contained in:
parent
183779e055
commit
bc2cfbeba3
1 changed files with 6 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
using Myriad.Extensions;
|
using Myriad.Extensions;
|
||||||
using Myriad.Types;
|
using Myriad.Types;
|
||||||
|
|
||||||
|
|
@ -79,7 +81,10 @@ public static class ContextEntityArgumentsExt
|
||||||
return memberByDisplayName;
|
return memberByDisplayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally (or if by-HID lookup is specified), try member HID parsing:
|
// Finally (or if by-HID lookup is specified), check if input is a valid HID and then try member HID parsing:
|
||||||
|
|
||||||
|
if (!Regex.IsMatch(input, @"^[a-zA-Z]{5}$"))
|
||||||
|
return null;
|
||||||
|
|
||||||
// For posterity:
|
// For posterity:
|
||||||
// There was a bug that made `SELECT * FROM MEMBERS WHERE HID = $1` hang forever BUT
|
// There was a bug that made `SELECT * FROM MEMBERS WHERE HID = $1` hang forever BUT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue