@@ -232,7 +232,7 @@ func pastePasswordedVerifyGet(ec echo.Context) error {
|
||||
func pastePasswordedVerifyPost(ec echo.Context) error {
|
||||
// We should check if database connection available.
|
||||
dbConn := c.Database.GetDatabaseConnection()
|
||||
// nolint
|
||||
|
||||
if c.Config.Database.Type != "flatfiles" && dbConn == nil {
|
||||
return ec.Redirect(http.StatusFound, "/database_not_available")
|
||||
}
|
||||
|
@@ -48,9 +48,9 @@ func pastePOSTWebInterface(ec echo.Context) error {
|
||||
return ec.HTML(http.StatusBadRequest, errtpl)
|
||||
}
|
||||
|
||||
// nolint
|
||||
if !strings.ContainsAny(params["paste-keep-for"][0], "Mmhd") && params["paste-keep-for"][0] != "forever" {
|
||||
c.Logger.Debug().Str("field value", params["paste-keep-for"][0]).Msg("'Keep paste for' field have invalid value")
|
||||
|
||||
errtpl := templater.GetErrorTemplate(ec, "Invalid 'Paste should be available for' parameter passed. Please do not try to hack us ;).")
|
||||
|
||||
return ec.HTML(http.StatusBadRequest, errtpl)
|
||||
|
Reference in New Issue
Block a user