Make id and delkey required for sql query

This commit is contained in:
Eliot Whalan 2016-06-28 08:07:55 +10:00
parent f45c5396b7
commit 8796dfe73b
1 changed files with 2 additions and 2 deletions

View File

@ -162,10 +162,10 @@ func delHandler(w http.ResponseWriter, r *http.Request) {
db, err := sql.Open("mysql", DATABASE)
check(err)
stmt, err := db.Prepare("delete from pastebin where delkey=?")
stmt, err := db.Prepare("delete from pastebin where delkey=? and id=?")
check(err)
res, err := stmt.Exec(html.EscapeString(delkey))
res, err := stmt.Exec(html.EscapeString(delkey), html.EscapeString(paste))
check(err)
_, err = res.RowsAffected()