Proper check for paste's password input. Fixes #4 and should also fix #5.

master
Stanislav Nikitin 5 years ago
parent 9f0beb7e3e
commit d7e9865c91

@ -342,11 +342,11 @@ func pastePOST(ec echo.Context) error {
paste.Private = false
privateCheckbox, privateCheckboxFound := params["paste-private"]
pastePassword, pastePasswordFound := params["paste-password"]
if privateCheckboxFound && privateCheckbox[0] == "on" || pastePasswordFound && len(pastePassword[0]) != 0 {
if privateCheckboxFound && privateCheckbox[0] == "on" || pastePasswordFound && pastePassword[0] != "" {
paste.Private = true
}
if len(pastePassword) != 0 {
if pastePassword[0] != "" {
paste.CreatePassword(pastePassword[0])
}

Loading…
Cancel
Save