Skip to content

Commit

Permalink
Merge pull request #71 from ponzu-cms/ponzu-dev
Browse files Browse the repository at this point in the history
[core] fixing overridden variable from request form value change
  • Loading branch information
nilslice authored Feb 9, 2017
2 parents a23e465 + 7fe9804 commit 7a85b28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions system/admin/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 7a85b28

Please sign in to comment.