feature: Added CultureInvariant RegexOption to WebhookUrlRegex (#1637)

Co-authored-by: Jake Mathews <jwm5vv@virginia.edu>
This commit is contained in:
mathewsjwh
2020-10-14 18:21:42 -04:00
committed by GitHub
parent fa5ef5e1c6
commit e3925a77a3

View File

@@ -33,7 +33,7 @@ namespace Discord.Webhook
: this(webhookUrl, new DiscordRestConfig()) { } : this(webhookUrl, new DiscordRestConfig()) { }
// regex pattern to match webhook urls // regex pattern to match webhook urls
private static Regex WebhookUrlRegex = new Regex(@"^.*(discord|discordapp)\.com\/api\/webhooks\/([\d]+)\/([a-z0-9_-]+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static Regex WebhookUrlRegex = new Regex(@"^.*(discord|discordapp)\.com\/api\/webhooks\/([\d]+)\/([a-z0-9_-]+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
/// <summary> Creates a new Webhook Discord client. </summary> /// <summary> Creates a new Webhook Discord client. </summary>
public DiscordWebhookClient(ulong webhookId, string webhookToken, DiscordRestConfig config) public DiscordWebhookClient(ulong webhookId, string webhookToken, DiscordRestConfig config)