save name as desc if absent

This commit is contained in:
Ted Unangst 2019-09-09 11:06:57 -04:00
parent ead0b2995e
commit ef2d89d7c9
1 changed files with 3 additions and 0 deletions

View File

@ -1275,6 +1275,9 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
xid += ".txt" xid += ".txt"
} }
desc := r.FormValue("donkdesc") desc := r.FormValue("donkdesc")
if desc == "" {
desc = name
}
url := fmt.Sprintf("https://%s/d/%s", serverName, xid) url := fmt.Sprintf("https://%s/d/%s", serverName, xid)
res, err := stmtSaveFile.Exec(xid, name, desc, url, media, 1, data) res, err := stmtSaveFile.Exec(xid, name, desc, url, media, 1, data)
if err != nil { if err != nil {