dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit a9fa4ac8d6b5afe34bb2c87c1a8f1ab6e6b3b749
parent 065b20e0986bc4123be9899b0fb93550d1113fa8
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 10 Jan 2023 20:26:47 -0800

unset url

Diffstat:
Mpkg/web/handlers/api/v1/slashInterceptor.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -9,6 +9,7 @@ import ( "dkforest/pkg/utils" "errors" "fmt" + "github.com/asaskevich/govalidator" "github.com/sirupsen/logrus" "sort" "strconv" @@ -1396,6 +1397,9 @@ func handleSystemCmd(c *Command) (handled bool) { func handleSetChatRoomExternalLink(c *Command) (handled bool) { if m := setUrlRgx.FindStringSubmatch(c.message); len(m) == 2 { externalURL := m[1] + if !govalidator.IsURL(externalURL) { + externalURL = "" + } room, err := database.GetChatRoomByID(c.room.ID) if err != nil { c.err = err