mirror of
https://codeberg.org/scip/ephemerup.git
synced 2025-12-16 20:20:58 +01:00
changes:
- added form list - added sort by time - fixed hanging channel in zip writer - removed download url from form template - added upload description - added linter to Makefiles - added missing test file
This commit is contained in:
@@ -180,6 +180,8 @@ func ZipDir(directory, zipfilename string) error {
|
||||
|
||||
if err != nil {
|
||||
failure <- "Failed to zip directory: " + err.Error()
|
||||
} else {
|
||||
close(failure)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -73,6 +73,15 @@ func FormCreate(c *fiber.Ctx, cfg *cfg.Config, db *Db) error {
|
||||
entry.Notify = nt
|
||||
}
|
||||
|
||||
if len(formdata.Description) != 0 {
|
||||
des, err := common.Untaint(formdata.Description, cfg.RegText)
|
||||
if err != nil {
|
||||
return JsonStatus(c, fiber.StatusForbidden,
|
||||
"Invalid description: "+err.Error())
|
||||
}
|
||||
entry.Description = des
|
||||
}
|
||||
|
||||
// get url [and zip if there are multiple files]
|
||||
returnUrl := strings.Join([]string{cfg.Url, "form", id}, "/")
|
||||
entry.Url = returnUrl
|
||||
|
||||
Reference in New Issue
Block a user