Browse Source

Replace -> ReplaceAll

pull/2141/head
Gabe Kangas 3 years ago committed by GitHub
parent
commit
99d034b1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      core/chat/events.go

4
core/chat/events.go

@ -141,8 +141,8 @@ func (s *Server) userMessageSent(eventData chatClientEvent) { @@ -141,8 +141,8 @@ func (s *Server) userMessageSent(eventData chatClientEvent) {
func logSanitize(userValue string) string {
// strip carriage return and newline from user-submitted values to prevent log injection
sanitizedValue := strings.Replace(userValue, "\n", "", -1)
sanitizedValue = strings.Replace(sanitizedValue, "\r", "", -1)
sanitizedValue := strings.ReplaceAll(userValue, "\n", "")
sanitizedValue = strings.ReplaceAll(sanitizedValue, "\r", "")
return fmt.Sprintf("userSuppliedValue(%s)", sanitizedValue)
}

Loading…
Cancel
Save