summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2017-02-09 01:13:15 -0800
committerGitHub <noreply@github.com>2017-02-09 01:13:15 -0800
commit7a85b284dec2bbb462969fb7e9e949b1a2ae720a (patch)
tree3e798b02ea23e7fe890324e4b0f86a721ecd0c77
parenta23e4659b9c2f418ce5183e79049f1baca9785c1 (diff)
parent7fe98041a3561f2cf92c13fb8f2cb2b7afbc2e5b (diff)
Merge pull request #71 from ponzu-cms/ponzu-dev
[core] fixing overridden variable from request form value change
-rw-r--r--system/admin/handlers.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index c5b3058..4bb5521 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -1306,6 +1306,8 @@ func approveContentHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ pendingID := req.FormValue("id")
+
t := req.FormValue("type")
if strings.Contains(t, "__") {
t = strings.Split(t, "__")[0]
@@ -1406,9 +1408,8 @@ func approveContentHandler(res http.ResponseWriter, req *http.Request) {
return
}
- pendID := req.FormValue("id")
- if pendID != "" {
- err = db.DeleteContent(req.FormValue("type")+":"+pendID, req.Form)
+ if pendingID != "" {
+ err = db.DeleteContent(req.FormValue("type")+":"+pendingID, req.Form)
if err != nil {
log.Println("Failed to remove content after approval:", err)
}