remove carriage returns
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"fornaxian.com/pixeldrain-web/pixelapi"
|
"fornaxian.com/pixeldrain-web/pixelapi"
|
||||||
"github.com/Fornaxian/log"
|
"github.com/Fornaxian/log"
|
||||||
@@ -64,6 +65,9 @@ func (wc *WebController) adminGlobalsForm(td *TemplateData, r *http.Request) (f
|
|||||||
if f.ReadInput(r) {
|
if f.ReadInput(r) {
|
||||||
var successfulUpdates = 0
|
var successfulUpdates = 0
|
||||||
for k, v := range f.Fields {
|
for k, v := range f.Fields {
|
||||||
|
// Remove carriage returns from input
|
||||||
|
v.EnteredValue = strings.ReplaceAll(v.EnteredValue, "\r", "")
|
||||||
|
|
||||||
if v.EnteredValue == globalsMap[v.Name] {
|
if v.EnteredValue == globalsMap[v.Name] {
|
||||||
continue // Change changes, no need to update
|
continue // Change changes, no need to update
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user