mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-13 15:47:17 +03:00
11 lines
270 B
Go
11 lines
270 B
Go
package sshchat
|
|
|
|
import "regexp"
|
|
|
|
var reStripData = regexp.MustCompile("[^[:ascii:]]")
|
|
|
|
// SanitizeData returns a string with only allowed characters for client-provided metadata inputs.
|
|
func SanitizeData(s string) string {
|
|
return reStripData.ReplaceAllString(s, "")
|
|
}
|