From d4253d7a55f7af862304fb65c461547055dd294a Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 17 Nov 2019 21:42:41 +0100 Subject: Update shazow/ssh-chat dependency (#947) --- vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go') diff --git a/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go b/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go index ed532c97..4f9775f8 100644 --- a/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go +++ b/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go @@ -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 { -- cgit v1.2.3