mirror of
https://github.com/github/codeql.git
synced 2026-04-20 14:34:04 +02:00
Correct ReplaceAll params
ReplaceAll doesn't take a count argument
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
// GOOD: The user-provided value is escaped before being written to the log.
|
||||
func handlerGood(req *http.Request) {
|
||||
username := req.URL.Query()["username"][0]
|
||||
escapedUsername := strings.ReplaceAll(username, "\n", "", -1)
|
||||
escapedUsername = strings.ReplaceAll(escapedUsername, "\r", "", -1)
|
||||
escapedUsername := strings.ReplaceAll(username, "\n", "")
|
||||
escapedUsername = strings.ReplaceAll(escapedUsername, "\r", "")
|
||||
log.Printf("user %s logged in.\n", escapedUsername)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user