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:
committed by
GitHub
co-authored by
Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent
16204b0de3
commit
2f95847546
@@ -263,9 +263,9 @@ func (h *Handler) SacuvajPodesavanja(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sledeci := r.FormValue("_next")
|
sledeci := "/podesavanja"
|
||||||
if sledeci == "" || !strings.HasPrefix(sledeci, "/") {
|
if next := r.FormValue("_next"); strings.HasPrefix(next, "/") && (len(next) == 1 || (next[1] != '/' && next[1] != '\\')) {
|
||||||
sledeci = "/podesavanja"
|
sledeci = next
|
||||||
}
|
}
|
||||||
|
|
||||||
// backup podešavanja — pri neispravnom unosu javljamo jasnu grešku
|
// backup podešavanja — pri neispravnom unosu javljamo jasnu grešku
|
||||||
|
|||||||
Reference in New Issue
Block a user