Potential fix for code scanning alert no. 9: Bad redirect check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
2026-06-16 03:13:43 +02:00
committed by GitHub
parent 7b55e55c26
commit f036fe4010
+3 -3
View File
@@ -263,9 +263,9 @@ func (h *Handler) SacuvajPodesavanja(w http.ResponseWriter, r *http.Request) {
}
}
sledeci := r.FormValue("_next")
if sledeci == "" || !strings.HasPrefix(sledeci, "/") {
sledeci = "/podesavanja"
sledeci := "/podesavanja"
if next := r.FormValue("_next"); strings.HasPrefix(next, "/") && (len(next) == 1 || (next[1] != '/' && next[1] != '\\')) {
sledeci = next
}
// backup podešavanja — pri neispravnom unosu javljamo jasnu grešku