mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Rename ctx.Form() to ctx.FormString() and move code into own file (#16571)
Followup from #16562 prepare for #16567 * Rename ctx.Form() to ctx.FormString() * Reimplement FormX func to need less code and cpu cycles * Move code into own file
This commit is contained in:
@@ -34,7 +34,7 @@ func SetEditorconfigIfExists(ctx *context.Context) {
|
||||
|
||||
// SetDiffViewStyle set diff style as render variable
|
||||
func SetDiffViewStyle(ctx *context.Context) {
|
||||
queryStyle := ctx.Form("style")
|
||||
queryStyle := ctx.FormString("style")
|
||||
|
||||
if !ctx.IsSigned {
|
||||
ctx.Data["IsSplitStyle"] = queryStyle == "split"
|
||||
@@ -62,7 +62,7 @@ func SetDiffViewStyle(ctx *context.Context) {
|
||||
|
||||
// SetWhitespaceBehavior set whitespace behavior as render variable
|
||||
func SetWhitespaceBehavior(ctx *context.Context) {
|
||||
whitespaceBehavior := ctx.Form("whitespace")
|
||||
whitespaceBehavior := ctx.FormString("whitespace")
|
||||
switch whitespaceBehavior {
|
||||
case "ignore-all", "ignore-eol", "ignore-change":
|
||||
ctx.Data["WhitespaceBehavior"] = whitespaceBehavior
|
||||
|
Reference in New Issue
Block a user