mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 07:10:05 +03:00
sanitize: Move global variables to top of file
This commit is contained in:
parent
4c968fc966
commit
c1a8912297
@ -2,7 +2,10 @@ package sanitize
|
||||
|
||||
import "regexp"
|
||||
|
||||
var reStripName = regexp.MustCompile("[^\\w.-]")
|
||||
var (
|
||||
reStripName = regexp.MustCompile("[^\\w.-]")
|
||||
reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]")
|
||||
)
|
||||
|
||||
const maxLength = 16
|
||||
|
||||
@ -17,8 +20,6 @@ func Name(s string) string {
|
||||
return s
|
||||
}
|
||||
|
||||
var reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]")
|
||||
|
||||
// Data returns a string with only allowed characters for client-provided metadata inputs.
|
||||
func Data(s string, maxlen int) string {
|
||||
if len(s) > maxlen {
|
||||
|
Loading…
x
Reference in New Issue
Block a user