mirror of
https://github.com/owncast/owncast.git
synced 2025-11-03 21:08:36 +08:00
Replace -> ReplaceAll
This commit is contained in:
@ -141,8 +141,8 @@ func (s *Server) userMessageSent(eventData chatClientEvent) {
|
|||||||
|
|
||||||
func logSanitize(userValue string) string {
|
func logSanitize(userValue string) string {
|
||||||
// strip carriage return and newline from user-submitted values to prevent log injection
|
// strip carriage return and newline from user-submitted values to prevent log injection
|
||||||
sanitizedValue := strings.Replace(userValue, "\n", "", -1)
|
sanitizedValue := strings.ReplaceAll(userValue, "\n", "")
|
||||||
sanitizedValue = strings.Replace(sanitizedValue, "\r", "", -1)
|
sanitizedValue = strings.ReplaceAll(sanitizedValue, "\r", "")
|
||||||
|
|
||||||
return fmt.Sprintf("userSuppliedValue(%s)", sanitizedValue)
|
return fmt.Sprintf("userSuppliedValue(%s)", sanitizedValue)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user