commit 18fd475ca580286f0c2bafd748c92f0887cc5ed5
parent 25508da69b6641e81badea4bca1c674df143d1ca
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Wed, 3 May 2023 09:26:33 -0700
fix regex
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/web/handlers/admin.go b/pkg/web/handlers/admin.go
@@ -568,7 +568,7 @@ func AdminEditUserHandler(c echo.Context) error {
data.Vetted = utils.DoParseBool(c.FormValue("vetted"))
data.CollectMetadata = utils.DoParseBool(c.FormValue("collect_metadata"))
data.ChatColor = c.FormValue("chat_color")
- colorRgx := regexp.MustCompile(`^#[0-9a-f]{6}$`)
+ colorRgx := regexp.MustCompile(`^#[0-9a-fA-F]{6}$`)
if !colorRgx.MatchString(data.ChatColor) {
data.Errors.Username = "Invalid color format"
}
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -3105,7 +3105,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]{6}$`)
+ colorRgx := regexp.MustCompile(`^#[0-9a-fA-F]{6}$`)
if !colorRgx.MatchString(data.ChatColor) {
data.Error = "Invalid color format"
return c.Render(http.StatusOK, "settings.chat", data)