This commit is contained in:
@@ -7,8 +7,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"gitea.dev/modules/base"
|
||||
"gitea.dev/modules/optional"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
// FormString returns the first value matching the provided key in the form as a string
|
||||
@@ -35,6 +36,11 @@ func (b *Base) FormStrings(key string) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Base) FormStringInt64s(key string) []int64 {
|
||||
vals, _ := base.StringsToInt64s(strings.Split(b.FormString(key), ","))
|
||||
return vals
|
||||
}
|
||||
|
||||
// FormTrim returns the first value for the provided key in the form as a space trimmed string
|
||||
func (b *Base) FormTrim(key string) string {
|
||||
return strings.TrimSpace(b.Req.FormValue(key))
|
||||
@@ -72,8 +78,3 @@ func (b *Base) FormOptionalBool(key string) optional.Option[bool] {
|
||||
v = v || strings.EqualFold(s, "on")
|
||||
return optional.Some(v)
|
||||
}
|
||||
|
||||
func (b *Base) SetFormString(key, value string) {
|
||||
_ = b.Req.FormValue(key) // force parse form
|
||||
b.Req.Form.Set(key, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user