dkforest

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

commit 1d0e28b7273bea0f2647bc302308ba593c1de742
parent bd6ac5299472bc1c8b3941e3d81e5765ce1b91c1
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed, 14 Dec 2022 10:47:33 -0500

simplify regex

Diffstat:
Mpkg/web/handlers/handlers.go | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -3078,7 +3078,7 @@ func changeSettingsForm(c echo.Context, data settingsChatData) error { //data.NotifyNewMessageSound = utils.DoParseInt64(c.Request().PostFormValue("notify_new_message_sound")) //data.NotifyTaggedSound = utils.DoParseInt64(c.Request().PostFormValue("notify_tagged_sound")) //data.NotifyPmmedSound = utils.DoParseInt64(c.Request().PostFormValue("notify_pmmed_sound")) - colorRgx := regexp.MustCompile(`(#(?:[0-9a-f]{2}){2,4}|#[0-9a-f]{3}|(?:rgba?|hsla?)\((?:\d+%?(?:deg|rad|grad|turn)?(?:,|\s)+){2,3}[\s\/]*[\d\.]+%?\))`) + colorRgx := regexp.MustCompile(`(#(?:[0-9a-f]{2}){2,4}|#[0-9a-f]{3}|(?:rgba?|hsla?)\((?:\d+%?(?:deg|rad|grad|turn)?(?:,|\s)+){2,3}[\s/]*[\d.]+%?\))`) if !colorRgx.MatchString(data.ChatColor) { data.Error = "Invalid color format" return c.Render(http.StatusOK, "settings.chat", data)