Code-Cleanup: toter Check, none-Sentinel, Login-Jitter raus
- entry.go: redundantes stored != "" entfernt - filepath-Sentinel "none" -> leerer String (Go-Zero-Value), Checks in entry.go/user.go und web/js/app.js vereinfacht - auth.go: zufaelligen Login-Jitter samt loginJitter-Variable und Test-Seam entfernt (war nur Spielerei, kein echter Schutz) - notes/migrations.md: einmalige "none"->"" Migration dokumentiert Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -75,16 +75,16 @@ func handleCreateEntry(w http.ResponseWriter, r *http.Request) {
|
||||
content = content[:1000]
|
||||
}
|
||||
|
||||
filepath := "none"
|
||||
filepath := ""
|
||||
if r.MultipartForm != nil {
|
||||
if files := r.MultipartForm.File["file"]; len(files) > 0 {
|
||||
if stored, err := storeImage(files[0]); err == nil && stored != "" {
|
||||
if stored, err := storeImage(files[0]); err == nil {
|
||||
filepath = stored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if filepath == "none" && content == "" {
|
||||
if filepath == "" && content == "" {
|
||||
writeError(w, http.StatusBadRequest, "Leerer Beitrag!")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user