make switchlanguage work with POST
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 15m6s
mozhi pipeline / Build and publish artifacts (push) Successful in 24m43s

This commit is contained in:
2023-10-11 15:57:28 +05:30
parent d4d45832c8
commit 99a4eca07b
4 changed files with 28 additions and 23 deletions

View File

@@ -1,6 +1,17 @@
package utils
import "regexp"
import (
"regexp"
"github.com/gofiber/fiber/v2"
)
func GetQueryOrFormValue(c *fiber.Ctx, key string) string {
if c.Method() == "POST" {
return c.FormValue(key)
} else {
return c.Query(key)
}
}
func Sanitize(str string, strip string) string {
nonAlphanumericRegex := regexp.MustCompile(`[^a-zA-Z]+`)