From 83c28cb857e47e8e2958745eeac7f97448909968 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 7 Feb 2018 14:57:38 +0100 Subject: [PATCH] Check for a valid WebhookURL (discord). Closes #367 --- bridge/discord/discord.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index d57f9122..1f7e50c8 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -369,6 +369,9 @@ func (b *bdiscord) stripCustomoji(text string) string { // splitURL splits a webhookURL and returns the id and token func (b *bdiscord) splitURL(url string) (string, string) { webhookURLSplit := strings.Split(url, "/") + if len(webhookURLSplit) != 7 { + log.Fatalf("%s is no correct discord WebhookURL", url) + } return webhookURLSplit[len(webhookURLSplit)-2], webhookURLSplit[len(webhookURLSplit)-1] }